visual c++ - VS2013 VC++ libcurl LNK2028 LNK2019 linking errors -
i'm trying libcurl working in vc++ project on vs2013 community. i've been toiling many hours, , i've tried on stack , google it, no avail.
my recent attempt sparked this answer, mentions libcurl nuget package. good, because comes of .lib files required. have run same problem this fellow, in i'm getting linker error.
i'm importing following libraries 'additional dependencies' in project configuration settings under linker -> input:
libcurl.lib;libeay32.lib;ssleay32.lib;ws2_32.lib;libssh2.lib;zlib.lib;wldap32.lib;
obviously, each 1 of these .lib files in different directory inside nuget package folder inside project folder, under linker -> general 'additional library directories' set to:
"pathtoproject\packages\curl.7.30.0.2\build\native\lib\v110\x64\release\static"; "pathtoproject\packages\zlib.1.2.8.1\build\native\lib\v110\win32\release\static\cdecl"; "pathtoproject\packages\openssl.1.0.1.21\build\native\lib\v110\x64\release\static\cdecl"; "pathtoproject\packages\libssh2.1.4.3.1\build\native\lib\v110\x64\release\static\cdecl";
i trying use static libraries, because don't want drag .dll's project executable if can avoid it. it's worth noting recent attempt @ using libcurl includes ssl , whatnot, don't need extras. really, need static libcurl library, can't find or compile 1 seems.
in code, i'm using include: #include "curl/curl.h"
i've added additional include directory correctly under 'additional include directories' under c/c++ -> general:
projectpath\packages\curl.7.30.0.2\build\native\include
now, compiles fine long don't try , use curl in project code.
so, errors when try , use curl in code:
curl *curl; curl = curl_easy_init();
that piece of code generates these errors:
1>main.obj : error lnk2028: unresolved token (0a000453) "extern "c" void * __cdecl curl_easy_init(void)" (?curl_easy_init@@$$j0yapaxxz) referenced in function "private: class system::string ^ __clrcall project::main::curlrequest(class system::string ^,class system::string ^,class system::string ^,class system::string ^)" (?curlrequest@main@project@@$$fa$aamp$aavstring@system@@p$aav34@000@z) 1>main.obj : error lnk2019: unresolved external symbol "extern "c" void * __cdecl curl_easy_init(void)" (?curl_easy_init@@$$j0yapaxxz) referenced in function "private: class system::string ^ __clrcall project::main::curlrequest(class system::string ^,class system::string ^,class system::string ^,class system::string ^)" (?curlrequest@main@project@@$$fa$aamp$aavstring@system@@p$aav34@000@z)
there of course more curl using code, bare minimum shows basics of linking error. can fix this? mentioned before i've tried whole range of solutions, of i'll list below:
many answers questions regarding problems using libcurl in vs projects mention downloading libcurl http://curl.haxx.se/latest.cgi?curl=win32-devel-msvc, link doesn't work of now, can't use it.
more answers compile libcurl source. source comes .vcproj files, none of compile me without hundreds of errors, that's out.
solved.
this github project .bat file downloads libcurl source, compiles it, , makes libraries (both static , dynamic). importing static library created (libcurl_a.lib) , using in project along include directory has worked.
i'll leave question unaccepted answer in case can provide other helpful steps have fixed problem had in using nuget package installation.
finally.
Comments
Post a Comment