Re: getaddrinfo is not statically compiled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/28/2010 08:35 AM, bassis wrote:
> 
> I have included the header netdb.h, where getaddrinfo is included, but gcc
> issues this warning:
> 
> warning: Using 'getaddrinfo' in statically linked applications requires at
> runtime the shared libraries from the glibc version used for linking
> 
> gcc -m32 -static -s -O2 -std=c99 -D_POSIX_C_SOURCE=200112L myprogram.c
> 
> How can I statically compile whatever file is missing ?

You can't.  The resolver library needs to load components dynamically,
and the mechanism used to do that requires that they must come from
the same glibc version as the code linked into the application.

You can either

a.  Package these libraries with your app, or
b.  Don't statically link with libc.

b. is far the best option, even if you statically link everything else.

Andrew.

http://people.redhat.com/drepper/no_static_linking.html

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux