How to find libs version (Newlib and UCLIBC) ?

Ian Lance Taylor iant@google.com
Sat Jul 3 21:50:00 GMT 2010


Name lastlong <brew_pt@yahoo.com> writes:

>> Not that I know of.  Some libraries define macros with
>> their version
>> information; e.g., glibc defines __GLIBC__ and
>> __GLIBC_MINOR__.
>> However, I don't know of any standard approach.1
>
> Thanks. I dint check the similar defines for Newlib or UClibc. 
> How do we use above in application? 
> Shall I check pre-processed files (source files where this define is used)?

For glibc you would #include almost any glibc header file, and then do
things like

#if __GLIBC__ == 2 && __GLIBC_MINOR__ == 11

I don't know about uClibc and newlib.

Ian



More information about the Gcc-help mailing list