So, how do you get started with cURL?
Visual Studio 2005 project files that get you started.
Problems that were resolved and how:
Mostly linker problems:
First linker problem you get
error LNK2019: unresolved external symbol __imp__curl_global_cleanup referenced in function _main error LNK2019: unresolved external symbol __imp__curl_easy_cleanup referenced in function _main error LNK2019: unresolved external symbol __imp__curl_easy_perform referenced in function _main error LNK2019: unresolved external symbol __imp__curl_easy_setopt referenced in function _main error LNK2019: unresolved external symbol __imp__curl_easy_init referenced in function _main error LNK2019: unresolved external symbol __imp__curl_global_init referenced in function _main
* Resolved by following yang’s grandmother’s 14 step process
SECOND linking problem you get (after resolving the first)
Linking... curllib.lib(ldap.obj) : error LNK2019: unresolved external symbol __imp__ldap_unbind_s referenced in function _Curl_ldap curllib.lib(ldap.obj) : error LNK2019: unresolved external symbol __imp__ldap_msgfree referenced in function _Curl_ldap
* Resolved by linking in wldap32.lib by yang
23 Comments
This fucking piece of shit didn’t help me one little fucking bit.
I followed it EXACTLY, SEVERAL TIMES!
All it did was give me more of the “unresolved external” errors.
Fuck this.
the only thing missing (that resolves the above problem) is to (last thing in step 15)
right click MyFirstAttempt
properties
all releases
configuration properties
linker
input
and set
additional dependencies
to
libcurl.lib ws2_32.lib winmm.lib wldap32.lib
its the wldap32.lib which is required, see:
http://curl.haxx.se/mail/lib-2007-11/0300.html
@Ryan: This is why software developers are so highly paid. Dumbasses like you dont have the patience to put any effort forth.
Thanks. One less person to compete with.
C’mon now Anonymous, you can’t say you haven’t ever been that frustrated before..
Just note, I am also trying to fix “unresolved external symbol __imp_ curl_easy_setopt” and adding the libs Ryan say doesn’t help.
Ok, if that can help other people, I found the problem :)
I’ve been so lucky to find it…
You have to add the preprocessors:
;BUILDING_LIBCURL;HTTP_ONLY
And, the libs that Ryan mentioned.
This way it works…
Thx ;-)
@Daivuk: THANK YOU! =)
@matt
Thanks big time, I just needed to link winmm.lib wldap32.lib and didn’t know what the libs to use.
@Daivuk
I don’t have to do that(using VS2008 and Curl 7.21.2) but thanks for that info too, I didn’t know about HTTP_ONLY.
Hi, You need to include curllib.lib to remove
error LNK2019: unresolved external symbol __imp__curl_global_cleanup referenced in function _main
error LNK2019: unresolved external symbol __imp__curl_easy_cleanup referenced in function _main
error LNK2019: unresolved external symbol __imp__curl_easy_perform referenced in function _main
error LNK2019: unresolved external symbol __imp__curl_easy_setopt referenced in function _main
error LNK2019: unresolved external symbol __imp__curl_easy_init referenced in function _main
error LNK2019: unresolved external symbol __imp__curl_global_init reference
For me to solve
… To solve unresolved external symbol …
Under VC++ 2008 was just add:
#include “stdio.h”
thanks you saved me some time
TYTYTYTYTYTTYTYTY OMG FINALLY GOT IT TO WORK!!! YOUR AWESOME :D +1
Thanks, scanned through the instructions and adjusted my project appropriately. Two minutes from start to finish.
You saved me from an evening of visual studio frustration!
just add
libcurl_imp.lib
with
libcurl.lib or libcurl.dll
to the linker.
Chand, I love you.
I can confirm libcurl_imp.lib solving the issue of compiling, although now when I run the program it can’t find the dll? any ideas?
@ Anonymous about it not being able to find the dll. Put the libcurl DLL next to your executable and make sure and distribute it along with your executable.
Make sure you have the library path setup in your project directory settings to the appropriate curl lib files (debug/release). In my case I have curl and curlpp in the same folder, so “..\curl\lib\LIB-Release” gets added to the project Library Directory settings release builds.
Hello !
For me what all of you said does not work :(
I get :
1>Filters.obj : error LNK2019: unresolved external symbol _curl_easy_cleanup@4 referenced in function “void __stdcall sendconfinfos(int)” (?sendconfinfos@@YGXH@Z)
1>Filters.obj : error LNK2019: unresolved external symbol _curl_easy_perform@4 referenced in function “void __stdcall sendconfinfos(int)” (?sendconfinfos@@YGXH@Z)
1>Filters.obj : error LNK2019: unresolved external symbol _curl_easy_init@0 referenced in function “void __stdcall sendconfinfos(int)” (?sendconfinfos@@YGXH@Z)
Here is my ‘Linker/Additional dependencies’ :
libcurl.lib curllib.lib WS2_32.Lib winmm.lib wldap32.lib curllib_static.lib libcurl_imp.lib ssleay32.lib openldap.lib libeay32.lib odbc32.lib odbccp32.lib strmbasd.lib
Here is my ‘Preprocessor/Preprocessor definitions’ :
_WIN32_WINNT=0x0400;WINVER=0x0400;DBG=1;DEBUG;_DEBUG;INC_OLE2;STRICT;WIN32;_WIN32;_DLL;_MT;_X86_=1;CURL_STATICLIB;BUILDING_LIBCURL;HTTP_ONLY
Here is my ‘Advanced/Undefine Preprocessor definitions’ : (these are inherited, but I disable it as said in the yang grandmother’s 14 steps)
_WINDLL;_USRDLL
I can’t handle it ! Could anyone help me ? I suppose there is some incompatibility with another Preprocessor definition but I do not find it…
Thank you for helping !
Thomas
Ok I found it finally :
You must set C/C++/Advanced/Calling Convention to “__cdecl (/Gd)”
I also removed anything from ‘Advanced/Undefine Preprocessor definitions’.
Hope it will help :)
PS : It happened to me because I was working from a driver sample originated configured as “__stdcall (/Gz)”.
Thanks so much for this guide. This fixed all my linking/unresolved issues errors. : )
Hey, I think your website might be having browser compatibility issues.
When I look at your blog in Opera, it looks fine but when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up! Other then that,
wonderful blog!
2 Trackbacks/Pingbacks
[…] in misc Instead of fighting with libcurl you could just use WinInet for your http needs if you are married to the Windows […]
[…] Atentos al paso 2, para solucionar los problemas de linkado con ldap: https://bobobobo.wordpress.com/2008/11/08/working-with-curl-getting-started-the-easy-way-on-win32/ […]