• Libcurl and Visual Studio 2010 - Either the program won't compile or crashes at init
    3 replies, posted
I've been trying to use [url=http://curl.haxx.se/libcurl/]Libcurl[/url] for a project of mine, but I cannot get it to work for some reason. I've compiled libcurl and tried [url=http://curl.haxx.se/mail/lib-2007-04/0120.html]various methods[/url], but I'm still getting the "unresolved externals" errors (shown below). I also got my program (which, for now, is [url=http://curl.haxx.se/libcurl/c/simple.html]the first example from Libcurl's website[/url]) to compile by using libcurldll.a, but then it crashes due to an access violation error at curl_easy_init(). (The dll file is in the program's directory) The unresolved external errors: [code]1>main.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt 1>main.obj : error LNK2001: unresolved external symbol __imp__curl_easy_perform 1>main.obj : error LNK2001: unresolved external symbol __imp__curl_easy_cleanup 1>main.obj : error LNK2001: unresolved external symbol __imp__curl_easy_init[/code] I have set my VC++ Directories like this: [img]http://www.1337upload.net/files/SS-2010-10-26_03.31.56.png[/img] And have set the Libcurl files there like this: C:\ ---Programming ------Custom Libraries ---------include ------------curl ---------------<curl headers> ---------lib ------------libcurl.dll ------------libcurl.lib ------------<various other files ending with .a> And I have added the libcurl.lib to the Linker's Input's Additional Dependencies: [img]http://www.1337upload.net/files/SS-2010-10-26_03.37.07.png[/img] (If I add the libcurldll.a here, the program compiles, but crashes at the init) If anyone has had any experience with curl/libcurl and could tell me what's wrong (and possibly even how to fix it), I'd appreciate that a lot!
Ah, some kind fellow at StackOverflow pointed out I was using the incorrect version of Libcurl (Win32 Generic instead of Win32 MSVC). Using the other one then fixed the problem (almost completely - the program worked flawlessly after downloading and putting zlib1.dll in the program's folder).
[QUOTE=Matthew0505;25651403]Is libcurl compiled in MinGW? If it is then see if there's a MSVC++ version[/QUOTE] Yeah, there is one. Seems like I missed it before.
Sorry, you need to Log In to post a reply to this thread.