Sunday, April 29, 2012

libcurl linking errors on Windows?

Are you getting libcurl link errors on Windows that look like this?

unresolved external symbol __imp__curl_easy_cleanup 
unresolved external symbol __imp__curl_easy_perform 
unresolved external symbol __imp__curl_easy_setopt
unresolved external symbol __imp__curl_easy_init

Fear no more!  First, ensure you are linking against the correct libraries, which should include:
libcurl.lib ws2_32.lib winmm.lib wldap32.lib

If this doesn't fix it, you probably need to add an additional Preprocessor Definition: CURL_STATICLIB - and it should fix the issue!  Hopefully this saves someone some time.

No comments:

Post a Comment