Closed themachho closed 2 years ago
Managed to compile and link an example for x64 (sill cant compile curlcpp.lib for x86) and it works. The only issue now is the LNK4217 warning
PS C:\Users\user\Documents\curlcpp_test> vcvarsall.bat x64 '&' cl /EHsc /DCURL_STATICLIB .\easy_info.cpp -I.\libs\curlcpp\ /link .\libs\curlcpp\64\libcurl_a.lib advapi32.lib crypt32.lib normaliz.lib wldap32.lib ws2_32.lib /nodefaultlib:libcmt.lib .\libs\curlcpp\64\curlcpp.lib
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Compilador de optimización de C/C++ de Microsoft (R) versión 19.29.30133 para x64
(C) Microsoft Corporation. Todos los derechos reservados.
easy_info.cpp
Microsoft (R) Incremental Linker Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:easy_info.exe
.\libs\curlcpp\64\libcurl_a.lib
advapi32.lib
crypt32.lib
normaliz.lib
wldap32.lib
ws2_32.lib
/nodefaultlib:libcmt.lib
.\libs\curlcpp\64\curlcpp.lib
easy_info.obj
LINK : warning LNK4217: "curl_easy_escape" importa el símbolo "libcurl_a.lib(escape.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: void __cdecl curl::curl_easy::escape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?escape@curl_easy@curl@@QEAAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)"
LINK : warning LNK4217: "curl_easy_unescape" importa el símbolo "libcurl_a.lib(escape.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: void __cdecl curl::curl_easy::unescape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?unescape@curl_easy@curl@@QEAAXAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)"
LINK : warning LNK4217: "curl_free" importa el símbolo "libcurl_a.lib(escape.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""private: static __cdecl <lambda_a5490d485619adb319274a36824fe087>::<lambda_invoker_cdecl>(char *)" (?<lambda_invoker_cdecl>@<lambda_a5490d485619adb319274a36824fe087>@@CA@PEAD@Z)"
LINK : warning LNK4217: "curl_global_init" importa el símbolo "libcurl_a.lib(easy.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: __cdecl curl::curl_interface<enum CURLcode>::global_initializer::global_initializer(long)" (??0global_initializer@?$curl_interface@W4CURLcode@@@curl@@QEAA@J@Z)"
LINK : warning LNK4217: "curl_global_cleanup" importa el símbolo "libcurl_a.lib(easy.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: __cdecl curl::curl_interface<enum CURLcode>::global_initializer::~global_initializer(void)" (??1global_initializer@?$curl_interface@W4CURLcode@@@curl@@QEAA@XZ)"
LINK : warning LNK4217: "curl_easy_strerror" importa el símbolo "libcurl_a.lib(strerror.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: __cdecl curl::curl_easy_exception::curl_easy_exception(enum CURLcode const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0curl_easy_exception@curl@@QEAA@AEBW4CURLcode@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)"
LINK : warning LNK4217: "curl_easy_pause" importa el símbolo "libcurl_a.lib(easy.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: void __cdecl curl::curl_easy::pause(int)" (?pause@curl_easy@curl@@QEAAXH@Z)"
LINK : warning LNK4217: "curl_easy_init" importa el símbolo "libcurl_a.lib(easy.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: __cdecl curl::curl_easy::curl_easy(long)" (??0curl_easy@curl@@QEAA@J@Z)"
LINK : warning LNK4217: "curl_easy_setopt" importa el símbolo "libcurl_a.lib(setopt.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: void __cdecl curl::curl_easy::add<10001>(void *)" (??$add@$0CHBB@@curl_easy@curl@@QEAAXPEAX@Z)"
LINK : warning LNK4217: "curl_easy_perform" importa el símbolo "libcurl_a.lib(easy.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: void __cdecl curl::curl_easy::perform(void)" (?perform@curl_easy@curl@@QEAAXXZ)"
LINK : warning LNK4217: "curl_easy_cleanup" importa el símbolo "libcurl_a.lib(easy.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: __cdecl curl::curl_easy::curl_easy(class curl::curl_easy const &)" (??0curl_easy@curl@@QEAA@AEBV01@@Z)"
LINK : warning LNK4217: "curl_easy_duphandle" importa el símbolo "libcurl_a.lib(easy.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: __cdecl curl::curl_easy::curl_easy(class curl::curl_easy const &)" (??0curl_easy@curl@@QEAA@AEBV01@@Z)"
LINK : warning LNK4217: "curl_easy_reset" importa el símbolo "libcurl_a.lib(easy.obj)" definido en "curlcpp.lib(curl_easy.obj)" en la función ""public: void __cdecl curl::curl_easy::reset(void)" (?reset@curl_easy@curl@@QEAAXXZ)"
PS C:\Users\user\Documents\curlcpp_test> .\easy_info.exe
text/html; charset=ISO-8859-1
Update: I added CURL_STATICLIB on visual studio Preprocessor before compile curlcpp.lib to solve the issues later since the example worked but no when i tryied to use in another program. x64 works great with no errors (except the linker warning) but x86 have this issue:
client.o : error LNK2019: símbolo externo __imp__curl_global_init@4 sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_interface<enum CURLcode>::global_initializer::global_initializer(long)" (??0global_initializer@?$curl_interface@W4CURLcode@@@curl@@QAE@J@Z)
client.o : error LNK2019: símbolo externo __imp__curl_global_cleanup@0 sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_interface<enum CURLcode>::global_initializer::~global_initializer(void)" (??1global_initializer@?$curl_interface@W4CURLcode@@@curl@@QAE@XZ)
client.o : error LNK2019: símbolo externo __imp__curl_easy_strerror@4 sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_easy_exception::curl_easy_exception(enum CURLcode const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0curl_easy_exception@curl@@QAE@ABW4CURLcode@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
client.o : error LNK2019: símbolo externo __imp__curl_easy_init@0 sin resolver al que se hace referencia en la función "public: __thiscall curl::curl_easy::curl_easy<class std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> > >(class curl::curl_ios<class std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> > > &)" (??$?0V?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@curl_easy@curl@@QAE@AAV?$curl_ios@V?$basic_ostringstream@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@1@@Z)
..\output\mydll.dll : fatal error LNK1120: 4 externos sin resolver
make: *** [../output/mydll.dll] Error 1120
Both following the same compile process. Im trying to find if its not a libcurl related issue but is strange that i have no errors on x64.
This seems to be a problem related to a missing curl library on your system. I've added the build for dynamic library, try again.
Hello. Im trying to build a project using curlcpp on windows (with makefile). I dont have the same issue on linux with -lcurl, only windows.
I have libcurl_a.lib (static 7.79) and the src/inc files of curlcpp that i want to compile (without using curlcpp.lib) and my file structure is this:
On my makefile i included this lines
DIRS += $(CURLCPP_DIR) $(CURLCPP_DIR)/curl (for includes for compiler) LIB_CURL = $(CURLCPP_DIR)/32 (or 64) LDFLAGS += ../$(LIB_CURL)/libcurl_a.lib Crypt32.lib Wldap32.lib Normaliz.lib ws2_32.lib winmm.lib (for linking)
The makefile calls vcvarsall for compile/link. While compile doesnt have issues, i got the following error at the linking stage:
I know that linking gets the libcurl lib because if i change the name/misspell it gives lib not found. Sorry i cant provide the full makefile and spanish language on the errors but are external/unresolved symbol.
Any ideas? I know that building curlcpp.lib is another option but im having issues with visual studio solution and x86 building conflicts.