Unresolved symbols when linking a program using libcurl

大城市里の小女人 提交于 2019-11-27 07:14:49

Looks like the libraries are not being successfully linked. Ensure the library directory is set to include the full path to the libcurl dll. Also make sure this library is actually added to your project.

I've been using static version of libcurl, and to link my program against it properly, I had to add definition:

CURL_STATICLIB

to build configuration of my project.

Besides defining CURL_STATICLIB, for me it was also necessary to link the following dependencies (including libcurl.lib or libcurld.lib):

  • Ws2_32.lib
  • Wldap32.lib

I ran into a similar issue - found that I was referencing the 64-bit location of libcurl.lib. Changed the link directory to the 32-bit location and the project compiled perfectly.

I had the same problem. I wrote how I finally was able to make CurlLib works, here: http://quantcorner.wordpress.com/2012/04/08/using-libcurl-with-visual-c-2010/ if you wish to have a look. Good luck!

After many ideas and configurations, I solved the problem adding this:

#pragma comment(lib, "lib/libcurl_a.lib")

where libcurl_a.lib is the name of the curl lib file and lib is the folder which contains it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!