Compile a static binary which code there a function gethostbyname
How to resolve compile a static binary which code include a function gethostbyname and if compiled without warning like this: warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking I compile on ubuntu 12.04 with command: $ gcc -static lookup.c -o lookup This is code for lookup.c: /* lookup.c */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> extern int h_errno; int