title: Linking libcurl while cross compiling with mingw32 under Linux for Windows
body: <p>I have compiled libcurl using mingw32 and am trying to link it with my program using mingw32 for a Windows system from my Linux machine.</p>
  
  <p>I was outputted the files, libcurl-4.dll libcurl.a libcurl.la libcurl.lai.</p>
  
  <p>I have included them in my mingw32 libs folder at: /usr/x86_64-w64-mingw32/lib</p>
  
  <p>I was able to find a few other topics on linking with the libstdc++ and libgcc to take care dependency errors while executed but when trying to add libcurl.a it will not compile period.</p>
  
  <p>I used the following:</p>
  
  <pre><code>$ x86_64-w64-mingw32-g++ main.cpp -o hello.exe -static-libgcc -static-libstdc++ -static "/usr/x86_64-w64-mingw32/lib/libcurl.a" -lpthread
  </code></pre>
  
  <p>However, I cannot not get it to use the libcurl.a and am continuing to receive these errors.</p>
  
  <pre><code>/tmp/ccIceRus.o:main.cpp:(.text+0xde): undefined reference to `__imp_curl_easy_init'
  /tmp/ccIceRus.o:main.cpp:(.text+0x106): undefined reference to `__imp_curl_easy_setopt'
  /tmp/ccIceRus.o:main.cpp:(.text+0x122): undefined reference to `__imp_curl_easy_setopt'
  /tmp/ccIceRus.o:main.cpp:(.text+0x13e): undefined reference to `__imp_curl_easy_setopt'
  /tmp/ccIceRus.o:main.cpp:(.text+0x159): undefined reference to `__imp_curl_easy_setopt'
  /tmp/ccIceRus.o:main.cpp:(.text+0x169): undefined reference to `__imp_curl_easy_perform'
  /tmp/ccIceRus.o:main.cpp:(.text+0x180): undefined reference to `__imp_curl_easy_strerror'
  /tmp/ccIceRus.o:main.cpp:(.text+0x197): undefined reference to `__imp_curl_easy_cleanup'
  /usr/bin/x86_64-w64-mingw32-ld: /tmp/ccIceRus.o: bad reloc address 0x80 in section `.xdata'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>What am I doing wrong?. I can not get past this. I know it has to be some stupid issue.</p>
  
  <p>Thank you.</p>