title: Static Library linked but still undefined references
body: <p>I am trying to link libcurl statically to my programm (just libcurl, not all of its dependencies). I build libcurl myself to get down the dependencies to a minimum that should be present on most linux systems anyway.</p>
  
  <p>I try to compile with </p>
  
  <pre><code>g++ foo.cpp -I/tmp/curl/include/curl/ -L/tmp/curl/lib/libcurl.a
  </code></pre>
  
  <p>but still get </p>
  
  <pre><code>curl_downloads.cpp:(.text+0xe): undefined reference to `curl_global_init'
  /tmp/ccY0XMUo.o: In function `curlDownloadToFile(void*, std::string const&amp;, std::string const&amp;, std::string const&amp;, std::string)': 
  curl_downloads.cpp:(.text+0x36): undefined reference to `curl_easy_init'
  curl_downloads.cpp:(.text+0xcb): undefined reference to `curl_easy_escape'
  curl_downloads.cpp:(.text+0x119): undefined reference to `curl_easy_setopt'
  curl_downloads.cpp:(.text+0x15d): undefined reference to `curl_easy_setopt'
  curl_downloads.cpp:(.text+0x178): undefined reference to `curl_easy_setopt'
  curl_downloads.cpp:(.text+0x192): undefined reference to `curl_easy_setopt'
  ...
  </code></pre>
  
  <p>but nm libcurl.a shows </p>
  
  <pre><code>nm libcurl.a | grep easy
                   U curl_easy_unescape
  0000000000000000 T curl_easy_escape
  00000000000002f0 T curl_easy_unescape
  libcurl_la-easy.o:
  0000000000000590 T curl_easy_cleanup  
  0000000000000630 T curl_easy_duphandle
  00000000000005f0 T curl_easy_getinfo
  0000000000000270 T curl_easy_init
  00000000000008e0 T curl_easy_pause
  0000000000000350 T curl_easy_perform
  0000000000000a60 T curl_easy_recv
  0000000000000800 T curl_easy_reset
  0000000000000ad0 T curl_easy_send
  00000000000002b0 T curl_easy_setopt
  0000000000000080 t easy_connection
  0000000000001580 T Curl_multi_set_easy_connection
               U curl_easy_init
  0000000000000000 T curl_easy_strerror
  </code></pre>
  
  <p>so the functions should be present.
  I also tried like every possible order of the arguments in the g++ call, I always get the missing references.</p>
  
  <p>So what am I missing here?</p>