Я изо всех сил пытался заставить cURLpp правильно собираться в течение 2 дней.
Я скачал и успешно установил libcurl, используя это руководство: Как заставить cURL работать с Visual Studios 2017
Затем я загрузил cURLpp со страницы github.Мне пришлось вручную установить каталог включения libcurl для cmake, чтобы сгенерировать файлы решения Visual Studio, но после этого все заработало.Когда я открыл решение и попытался собрать cURLpp, я получил все эти ошибки:
Rebuild All started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>Checking Build System
1>CMake does not need to re-run because E:/curlpp-0.8.1/CMakeFiles/generate.stamp is up-to-date.
1>CMake does not need to re-run because E:/curlpp-0.8.1/extras/CMakeFiles/generate.stamp is up-to-date.
2>------ Rebuild All started: Project: curlpp, Configuration: Debug Win32 ------
3>------ Rebuild All started: Project: curlpp_static, Configuration: Debug Win32 ------
2>Building Custom Rule E:/curlpp-0.8.1/CMakeLists.txt
2>CMake does not need to re-run because E:/curlpp-0.8.1/CMakeFiles/generate.stamp is up-to-date.
2>Easy.cpp
3>Building Custom Rule E:/curlpp-0.8.1/CMakeLists.txt
3>CMake does not need to re-run because E:/curlpp-0.8.1/CMakeFiles/generate.stamp is up-to-date.
3>Easy.cpp
2>Exception.cpp
3>Exception.cpp
2>Form.cpp
3>Form.cpp
2>Info.cpp
3>Info.cpp
2>Multi.cpp
3>Multi.cpp
2>OptionBase.cpp
2>Options.cpp
3>OptionBase.cpp
3>Options.cpp
2>cURLpp.cpp
2>CurlHandle.cpp
3>cURLpp.cpp
3>CurlHandle.cpp
2>OptionList.cpp
3>OptionList.cpp
2>OptionSetter.cpp
2>E:\curlpp-0.8.1\src\curlpp\internal\OptionSetter.cpp(78): warning C4244: 'initializing': conversion from 'std::streamsize' to '::size_t', possible loss of data
3>OptionSetter.cpp
2>SList.cpp
3>E:\curlpp-0.8.1\src\curlpp\internal\OptionSetter.cpp(78): warning C4244: 'initializing': conversion from 'std::streamsize' to '::size_t', possible loss of data
3>SList.cpp
2>Generating Code...
2> Creating library E:/curlpp-0.8.1/Debug/curlpp.lib and object E:/curlpp-0.8.1/Debug/curlpp.exp
3>Generating Code...
2>Form.obj : error LNK2019: unresolved external symbol __imp__curl_formadd referenced in function "private: virtual void __thiscall curlpp::FormParts::File::add(struct curl_httppost * *,struct curl_httppost * *)" (?add@File@FormParts@curlpp@@EAEXPAPAUcurl_httppost@@0@Z)
2>Form.obj : error LNK2019: unresolved external symbol __imp__curl_formfree referenced in function "public: void __thiscall curlpp::HttpPost::clear(void)" (?clear@HttpPost@curlpp@@QAEXXZ)
2>Info.obj : error LNK2019: unresolved external symbol __imp__curl_easy_getinfo referenced in function "public: void __thiscall curlpp::internal::CurlHandle::getInfo<long>(enum CURLINFO,long &)const " (??$getInfo@J@CurlHandle@internal@curlpp@@QBEXW4CURLINFO@@AAJ@Z)
2>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_init referenced in function "public: __thiscall curlpp::Multi::Multi(void)" (??0Multi@curlpp@@QAE@XZ)
2>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_add_handle referenced in function "public: void __thiscall curlpp::Multi::add(class curlpp::Easy const *)" (?add@Multi@curlpp@@QAEXPBVEasy@2@@Z)
2>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_remove_handle referenced in function "public: __thiscall curlpp::Multi::~Multi(void)" (??1Multi@curlpp@@QAE@XZ)
2>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_fdset referenced in function "public: void __thiscall curlpp::Multi::fdset(struct fd_set *,struct fd_set *,struct fd_set *,int *)" (?fdset@Multi@curlpp@@QAEXPAUfd_set@@00PAH@Z)
2>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_perform referenced in function "public: bool __thiscall curlpp::Multi::perform(int *)" (?perform@Multi@curlpp@@QAE_NPAH@Z)
2>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_cleanup referenced in function "public: __thiscall curlpp::Multi::~Multi(void)" (??1Multi@curlpp@@QAE@XZ)
2>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_info_read referenced in function "public: class std::list<struct std::pair<class curlpp::Easy const *,struct curlpp::Multi::Info>,class std::allocator<struct std::pair<class curlpp::Easy const *,struct curlpp::Multi::Info> > > __thiscall curlpp::Multi::info(void)" (?info@Multi@curlpp@@QAE?AV?$list@U?$pair@PBVEasy@curlpp@@UInfo@Multi@2@@std@@V?$allocator@U?$pair@PBVEasy@curlpp@@UInfo@Multi@2@@std@@@2@@std@@XZ)
2>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_strerror referenced in function "public: void __thiscall curlpp::Multi::add(class curlpp::Easy const *)" (?add@Multi@curlpp@@QAEXPBVEasy@2@@Z)
2>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_getenv referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::getenv(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getenv@curlpp@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z)
2>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_version referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::libcurlVersion(void)" (?libcurlVersion@curlpp@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
2>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_escape referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::escape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?escape@curlpp@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z)
2>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_unescape referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::unescape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?unescape@curlpp@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z)
2>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_free referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl curlpp::escape(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?escape@curlpp@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z)
2>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_global_init referenced in function "void __cdecl curlpp::initialize(long)" (?initialize@curlpp@@YAXJ@Z)
2>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_global_cleanup referenced in function "void __cdecl curlpp::terminate(void)" (?terminate@curlpp@@YAXXZ)
2>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_getdate referenced in function "__int64 __cdecl curlpp::getdate(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,__int64 *)" (?getdate@curlpp@@YA_JABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PA_J@Z)
2>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_init referenced in function "public: __thiscall curlpp::internal::CurlHandle::CurlHandle(void)" (??0CurlHandle@internal@curlpp@@QAE@XZ)
2>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_setopt referenced in function "public: void __thiscall curlpp::internal::CurlHandle::option<void *>(enum CURLoption,void *)" (??$option@PAX@CurlHandle@internal@curlpp@@QAEXW4CURLoption@@PAX@Z)
2>OptionSetter.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt
2>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_perform referenced in function "public: void __thiscall curlpp::internal::CurlHandle::perform(void)" (?perform@CurlHandle@internal@curlpp@@QAEXXZ)
2>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_cleanup referenced in function "public: virtual __thiscall curlpp::internal::CurlHandle::~CurlHandle(void)" (??1CurlHandle@internal@curlpp@@UAE@XZ)
2>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_duphandle referenced in function "public: class std::unique_ptr<class curlpp::internal::CurlHandle,struct std::default_delete<class curlpp::internal::CurlHandle> > __thiscall curlpp::internal::CurlHandle::clone(void)const " (?clone@CurlHandle@internal@curlpp@@QBE?AV?$unique_ptr@VCurlHandle@internal@curlpp@@U?$default_delete@VCurlHandle@internal@curlpp@@@std@@@std@@XZ)
2>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_reset referenced in function "public: void __thiscall curlpp::internal::CurlHandle::reset(void)" (?reset@CurlHandle@internal@curlpp@@QAEXXZ)
2>SList.obj : error LNK2019: unresolved external symbol __imp__curl_slist_append referenced in function "private: void __thiscall curlpp::internal::SList::update(void)" (?update@SList@internal@curlpp@@AAEXXZ)
2>SList.obj : error LNK2019: unresolved external symbol __imp__curl_slist_free_all referenced in function "private: void __thiscall curlpp::internal::SList::clear(void)" (?clear@SList@internal@curlpp@@AAEXXZ)
2>C:\Users\a\vcpkg\packages\curl_x64-windows\lib\libcurl.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
2>E:\curlpp-0.8.1\Debug\curlpp.dll : fatal error LNK1120: 27 unresolved externals
2>Done building project "curlpp.vcxproj" -- FAILED.
3>curlpp_static.vcxproj -> E:\curlpp-0.8.1\Debug\libcurlpp.lib
3>Done building project "curlpp_static.vcxproj".
4>------ Rebuild All started: Project: ALL_BUILD, Configuration: Debug Win32 ------
4>Building Custom Rule E:/curlpp-0.8.1/CMakeLists.txt
4>CMake does not need to re-run because E:/curlpp-0.8.1/CMakeFiles/generate.stamp is up-to-date.
5>------ Skipped Rebuild All: Project: INSTALL, Configuration: Debug Win32 ------
5>Project not selected to build for this solution configuration
========== Rebuild All: 3 succeeded, 1 failed, 1 skipped ==========
Я был очень расстроен, пытаясь заставить это работать, но мои усилия были напрасны.Я был бы очень признателен за руководство.