Page 1 of 1

[done] What to import to use gnu_get_libc_version function?

Posted: Thu Apr 23, 2015 8:52 am
by Kukulkan
Hi,

I like to find the libc version (2.14, 2.15 etc) of the Linux machine I'm running on using PureBasic.

I wanted to use like this:

Code: Select all

Protected libcVersion.s = gnu_get_libc_version_()
But it is not available. What do I need to import to get this? No, I don't want to do a comandline call :-)

Thanks,

Kukulkan

Re: What to import to use gnu_get_libc_version() function?

Posted: Thu Apr 23, 2015 11:23 am
by infratec
Hi,

this works for me:

Code: Select all

ImportC "-lc"
  gnu_get_libc_version()
  gnu_get_libc_release()
EndImport

Debug PeekS(gnu_get_libc_version(), -1, #PB_UTF8)
Debug PeekS(gnu_get_libc_release(), -1, #PB_UTF8)
Bernd

Re: What to import to use gnu_get_libc_version() function?

Posted: Thu Apr 23, 2015 11:39 am
by bbanelli
infratec wrote:Hi,

this works for me:

Code: Select all

ImportC "-lc"
  gnu_get_libc_version()
  gnu_get_libc_release()
EndImport

Debug PeekS(gnu_get_libc_version(), -1, #PB_UTF8)
Debug PeekS(gnu_get_libc_release(), -1, #PB_UTF8)
Bernd
I can confirm it on Ubuntu too, it works, however, IMO, their versioning is quite bizarre. For some reason, the current version is 2.21, which is actually preceded by all natural numbers up to 3, where it has "normal" nomenclature such as 2.3.x. That being said, for example, version 2.8 is actually older than 2.21, etc. - but there is no build/revision designation. Strange people, those penguins...

Re: What to import to use gnu_get_libc_version() function?

Posted: Thu Apr 23, 2015 11:44 am
by Kukulkan
Thanks infratec! Works fine for me :-)

Kind regards,

Kukulkan