1

I am having a hard time linking cURL to my project on vs12 ...

I opted for the .msi solution that I picked here: http://www.confusedbycode.com/curl/

and tried to link that to my project... However I am still getting some errors after doing what I thought was right:

1>main.obj : error LNK2019: unresolved external symbol _curl_easy_init referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol _curl_easy_setopt referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol _curl_easy_perform referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol _curl_easy_cleanup referenced in function _main

My configuration in my project vs12 is the following:

  • I included the include folder and the the lib folder in the vc++ directories
  • I added CURL_STATICLIB to the Preprocessor definition in C/C++ section as well as adding the proper include folder
  • I added the lib folder to the Linker sectio as well as libcurl.lib

Eventually I just included "curl.h" to the relevant .cpp file...

Is there something that I am missing?

Thank you a lot

trexgris
  • 362
  • 3
  • 14
  • As from your steps stated you actually missed to add `-lcurl` to the list of your linked libraries. – πάντα ῥεῖ Aug 09 '15 at 22:02
  • thank you for your answer. Could you tell me where I have to add this command in visual studio (2012) ? – trexgris Aug 09 '15 at 22:08
  • @trexgris If you have curl installed on your machine, right click your project in visual studio and click properties. Go to Linker->input, there you can add the correct `*.lib` under additional dependencies. – James Moore Aug 09 '15 at 22:22
  • @JamesMoore as I was saying in my post I already added the libcurl.lib, and then I still got the errors quoted in my op – trexgris Aug 09 '15 at 22:25
  • @trexgris Try uninstalling the curl installer package as it may have messed up some paths. Only download the libs folder and link. – James Moore Aug 09 '15 at 22:35
  • @JamesMoore I have tried and If I do so I won't have the .lib. So then I need to compile the library but it is requiring OpenSSL so it's a bit of a pain since the .msi that I have downloaded allows me to get the precompiled libcURL llibrary. – trexgris Aug 10 '15 at 08:41

0 Answers0