title: /Mingw32/bin/ld.exe: cannot find -llibcurl?
body: <p>I am trying to compile Libcurl for my project but I am getting below error.</p>
  
  <pre><code>g++ -g -o Main.exe Main.o I"C:\Test\src\WebSocket\curl" L"C:\Test\src\WebSocket\lib" -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -DCURL_STATICLIB -llibcurl 
  
  /mingw32/bin/ld.exe: cannot find -llibcurl
  </code></pre>
  
  <p>When I built libcurl using mingw32 I got two files i.e. libcurl.a, libcurl.la.
  I added both files under <strong>c:\Test\src\websocket\lib</strong>.Also, all the required headers are under <strong>C:\Test\src\WebSocket\curl</strong>
  I am not sure why linker is unable to link these libraries.</p>
  
  <p>What I have tried:</p>
  
  <p>Initially I was getting error like :</p>
  
  <pre><code>main.cpp:11: undefined reference to __imp__curl_easy_init'
  main.cpp:13: undefined reference to __imp__curl_easy_setopt'
  main.cpp:14: undefined reference to __imp__curl_easy_perform'
  main.cpp:17: undefined reference to __imp__curl_easy_cleanup'
  </code></pre>
  
  <p>After going SO posts,I realized I forgot to link my libcurl library which I did as below:</p>
  
  <pre><code>WS_DIR = "C:\Test\src\WebSocket\curl"
  WS_LIB = "C:\Test\src\WebSocket\lib"
  
  g++ -c -std=c++11 -g -fpermissive src/Main.cpp -I${WS_DIR} -L${WS_LIB}  -D_WIN32_WINNT=0x0601 -DWINVER=0x0601 -DCURL_STATICLIB -llibcurl
  </code></pre>
  
  <p>But now i am facing linking issue.</p>
  
  <p>Can anybody with good compiler and libcurl understanding help for this?</p>
  
  <p>@Jaochim : thanks to you I have changed my make file.But now I am facing errors as below :</p>
  
  <pre><code>\src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x158): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x30a): undefined reference to `getpeername'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x313): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x377): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x3f0): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x419): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x515): undefined reference to `recv'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x6ba): undefined reference to `socket'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x861): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0xbbb): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0xd8b): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0xdfb): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0xf0d): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-connect.o):(.text+0x137d): more undefined references to `__errno' follow
  \src\WebSocket\lib\libcurl.a(libcurl_la-select.o):(.text+0x7a): undefined reference to `poll'
  \src\WebSocket\lib\libcurl.a(libcurl_la-select.o):(.text+0xa3): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-select.o):(.text+0x18d): undefined reference to `poll'
  \src\WebSocket\lib\libcurl.a(libcurl_la-select.o):(.text+0x197): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-select.o):(.text+0x205): undefined reference to `poll'
  \src\WebSocket\lib\libcurl.a(libcurl_la-select.o):(.text+0x31d): undefined reference to `poll'
  \src\WebSocket\lib\libcurl.a(libcurl_la-select.o):(.text+0x329): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-nonblock.o):(.text+0x1d): undefined reference to `fcntl'
  \src\WebSocket\lib\libcurl.a(libcurl_la-nonblock.o):(.text+0x3e): undefined reference to `fcntl'
  \src\WebSocket\lib\libcurl.a(libcurl_la-nonblock.o):(.text+0x5e): undefined reference to `fcntl'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0xf1): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x64b): undefined reference to `sigprocmask'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x6e5): undefined reference to `sigaction'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x722): undefined reference to `sigaction'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x748): undefined reference to `alarm'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x765): undefined reference to `sigprocmask'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x771): undefined reference to `setjmp'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x851): undefined reference to `alarm'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x875): undefined reference to `sigaction'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x888): undefined reference to `alarm'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip.o):(.text+0x8be): undefined reference to `alarm'
  \src\WebSocket\lib\libcurl.a(libcurl_la-cookie.o):(.text+0x3fe): undefined reference to `strtok_r'
  \src\WebSocket\lib\libcurl.a(libcurl_la-cookie.o):(.text+0x47c): undefined reference to `strtok_r'
  \src\WebSocket\lib\libcurl.a(libcurl_la-cookie.o):(.text+0x128e): undefined reference to `_impure_ptr'
  \src\WebSocket\lib\libcurl.a(libcurl_la-cookie.o):(.text+0x1a4d): undefined reference to `_impure_ptr'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http.o):(.text+0x155): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http.o):(.text+0x1a2): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http.o):(.text+0xc29): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http.o):(.text+0x11df): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http.o):(.text+0x163b): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http.o):(.text+0x17cc): more undefined references to `_imp___ctype_' follow
  \src\WebSocket\lib\libcurl.a(libcurl_la-sendf.o):(.text+0x121): undefined reference to `recv'
  \src\WebSocket\lib\libcurl.a(libcurl_la-sendf.o):(.text+0x136): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-sendf.o):(.text+0xa07): undefined reference to `recv'
  \src\WebSocket\lib\libcurl.a(libcurl_la-sendf.o):(.text+0xa28): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-sendf.o):(.text+0xada): undefined reference to `send'
  \src\WebSocket\lib\libcurl.a(libcurl_la-sendf.o):(.text+0xb01): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-url.o):(.text+0x523): undefined reference to `_impure_ptr'
  \src\WebSocket\lib\libcurl.a(libcurl_la-url.o):(.text+0x2dd8): undefined reference to `_impure_ptr'
  \src\WebSocket\lib\libcurl.a(libcurl_la-url.o):(.text+0x3bf1): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-url.o):(.text+0x3d19): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-url.o):(.text+0x60b4): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-if2ip.o):(.text+0x67): undefined reference to `socket'
  \src\WebSocket\lib\libcurl.a(libcurl_la-if2ip.o):(.text+0xb3): undefined reference to `ioctl'
  \src\WebSocket\lib\libcurl.a(libcurl_la-escape.o):(.text+0x19e): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-mprintf.o):(.text+0xb): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-mprintf.o):(.text+0x1667): undefined reference to `_impure_ptr'
  \src\WebSocket\lib\libcurl.a(libcurl_la-mprintf.o):(.text+0x16f2): undefined reference to `_impure_ptr'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0x18a): undefined reference to `send'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0x1b3): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0x7b7): undefined reference to `send'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0x93f): undefined reference to `send'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0x950): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0x977): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0xc01): undefined reference to `send'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0xc47): undefined reference to `send'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0xc54): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-telnet.o):(.text+0xcc6): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-netrc.o):(.text+0xfb): undefined reference to `strtok_r'
  \src\WebSocket\lib\libcurl.a(libcurl_la-netrc.o):(.text+0x394): undefined reference to `geteuid'
  \src\WebSocket\lib\libcurl.a(libcurl_la-netrc.o):(.text+0x3c3): undefined reference to `getpwuid_r'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http_chunks.o):(.text+0x514): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http_digest.o):(.text+0x1ac): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http_digest.o):(.text+0x3b0): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-http_digest.o):(.text+0x56a): undefined reference to `strtok_r'
  \src\WebSocket\lib\libcurl.a(libcurl_la-strtoofft.o):(.text+0x68): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-strtoofft.o):(.text+0x23f): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-hostip4.o):(.text+0x84): undefined reference to `gethostbyname'
  \src\WebSocket\lib\libcurl.a(libcurl_la-parsedate.o):(.text+0x91): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-parsedate.o):(.text+0xf5): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-parsedate.o):(.text+0xfc): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-parsedate.o):(.text+0x124): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-parsedate.o):(.text+0x12f): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-parsedate.o):(.text+0x2d5): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-parsedate.o):(.text+0x804): undefined reference to `gmtime_r'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x3e4): undefined reference to `sendto'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x453): undefined reference to `sendto'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x4ec): undefined reference to `sendto'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x4f9): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x58f): undefined reference to `sendto'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x7b2): undefined reference to `sendto'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x84a): undefined reference to `sendto'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x928): undefined reference to `sendto'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x931): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x990): undefined reference to `sendto'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x9a7): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0xe59): undefined reference to `sendto'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0xe62): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x10e9): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x1306): undefined reference to `recvfrom'
  \src\WebSocket\lib\libcurl.a(libcurl_la-tftp.o):(.text+0x1509): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-imap.o):(.text+0x2d): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-smtp.o):(.text+0x2f): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-rtsp.o):(.text+0x10cd): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-rtsp.o):(.text+0x1162): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-curl_gethostname.o):(.text+0x1d): undefined reference to `gethostname'
  \src\WebSocket\lib\libcurl.a(libcurl_la-curl_sasl.o):(.text+0x545): undefined reference to `strtok_r'
  \src\WebSocket\lib\libcurl.a(libcurl_la-file.o):(.text+0xa32): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-formdata.o):(.text+0x1589): undefined reference to `_impure_ptr'
  \src\WebSocket\lib\libcurl.a(libcurl_la-formdata.o):(.text+0x1599): undefined reference to `_impure_ptr'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftp.o):(.text+0x3c4): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftp.o):(.text+0x5f4): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftp.o):(.text+0xe44): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftp.o):(.text+0xf51): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftp.o):(.text+0xfbf): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftp.o):(.text+0x1233): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftp.o):(.text+0x126c): more undefined references to `__errno' follow
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftp.o):(.text+0x30f5): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftp.o):(.text+0x4a8f): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftplistparser.o):(.text+0x4a5): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftplistparser.o):(.text+0x7f9): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftplistparser.o):(.text+0x85b): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftplistparser.o):(.text+0x915): more undefined references to `_imp___ctype_' follow
  \src\WebSocket\lib\libcurl.a(libcurl_la-ftplistparser.o):(.text+0x10da): undefined reference to `__errno'
  \src\WebSocket\lib\libcurl.a(libcurl_la-curl_fnmatch.o):(.text+0xec): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-curl_fnmatch.o):(.text+0x12d): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-curl_fnmatch.o):(.text+0x1e1): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-curl_fnmatch.o):(.text+0x239): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-curl_fnmatch.o):(.text+0x2da): undefined reference to `_imp___ctype_'
  \src\WebSocket\lib\libcurl.a(libcurl_la-curl_fnmatch.o):(.text+0x325): more undefined references to `_imp___ctype_' follow
  </code></pre>