title: Create statically-linked binary that uses getaddrinfo?
body: <p>I have included the header <code>netdb.h</code>, where <code>getaddrinfo</code> is included, but gcc issues this warning:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>How can I statically compile whatever file is missing ?</p>
  
  <p><strong>Possible solutions:</strong></p>
  
  <ol>
  <li><p>It could be that the glibc installation is missing the corresponding object file necessary for static compilation. If that is the case, create the corresponding object file and link it at compilation.</p></li>
  <li><p>Try EGLIBC instead of glibc.</p></li>
  <li><p>I succesfully compiled my program with dietlibc which compiled without any errors plus the resulting binary was much smaller than what glibc makes.</p></li>
  </ol>