Failing to compile curlpp - c++

I've been on this for a few hours now (and that's just today) so I could really use some help. I always code in a Windows environment so I am trying to add curlpp to my Code::Blocks project.
I downloaded curl-7.22.0-devel-mingw32 and added all those libraries to Code::Blocks project.
I downloaded curl-7.22.0 and compiled it using vc6curl.dsw which made libcurl.lib, added that to Code::Blocks project.
Downloaded curlpp-0.7.3
Added MinGW\lib\libwsock32.a to Code::Blocks project.
Added the following directories to the project:
curlpp-0.7.3\include and curl-7.22.0\include
But I get a lot of "undefined reference" errors, so I'm guessing that means curlpp needs compiling too. It contains a VC8 project, so I downloaded Visual C++ 2005 Express and installed.
First error I get when opening the project is that the examples couldn't be loaded. Not really a problem, I guess. Trying to build the project right away, gives the error "Cannot open include file: 'curl/curl.h'" so I add the cURL includes folder curl-7.22.0\include to the project and try again.
1>------ Build started: Project: curlpp, Configuration: DebugDynamic Win32 ------
1>Compiling...
1>cURLpp.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Easy.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Exception.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Form.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Info.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Multi.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>OptionBase.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>Options.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>CurlHandle.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>OptionList.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>OptionSetter.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>SList.cpp
1>C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include\curl/curl.h(62) : fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory
1>WIN32
1>c1xx : fatal error C1083: Cannot open source file: 'WIN32': Permission denied
1>Generating Code...
1>Project : warning PRJ0018 : The following environment variables were not found:
1>$(BOOST_PATH)
1>$(LIBCURL_PATH)
1>Build log was saved at "file://c:\Users\admin\Downloads\curlpp-0.7.3-2\curlpp-0.7.3\DebugDynamic\BuildLog.htm"
1>curlpp - 13 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Erorr upon error upon error, it's driving me nuts. Googeling that one doesn't really help either. I found some forum posts saying WS2_32.Lib had to be added, and that's in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib but adding that to the libraries folder in the VS2005 project doesn't seem to do anything.
I'm just losing track of it all.. how is this supposed to go? I thought it would be as simple as:
Compile curl
Compile curlpp
Profit!
But unfortunately it doesn't seem to be that easy.
UPDATE
Oh yeah, I forgot, initially I also got these errors:
c1xx : fatal error C1083: Cannot open source file: '.\src\curlpp\Infos.cpp': No such file or directory
c1xx : fatal error C1083: Cannot open source file: '.\src\curlpp\Option.cpp': No such file or directory
c1xx : fatal error C1083: Cannot open source file: '.\src\utilspp\singleton\LifetimeLibrary.cpp': No such file or directory
c1xx : fatal error C1083: Cannot open source file: '.\src\utilspp\singleton\PrivateMembers.cpp': No such file or directory
But in src\curlpp there are:
Info.cpp
Options.cpp
So I just copied them and renamed the copies to
Info2.cpp
Option.cpp
And in src\utilspp there are
LifetimeLibrary.cpp
PrivateMembers.cpp
So I just made a folder "singleton" there and copied the files in there.
It's as if curlpp is.. broken? But it must be something weird I am doing because someone would have noticed!
UPDATE2
Ok I started from scratch and figured out that I also had to add the includes folder from the windows SDK. This took care of the Cannot open include file: 'winsock2.h' errors. But now I'm getting a buttload of other errors:
1>------ Build started: Project: curlpp, Configuration: DebugDynamic Win32 ------
1>Linking...
1>Infos.obj : error LNK2005: "public: static void __cdecl curlpp::InfoTypeConverter<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::get(class curlpp::Easy &,enum CURLINFO,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?get#?$InfoTypeConverter#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###curlpp##SAXAAVEasy#2#W4CURLINFO##AAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) already defined in Info.obj
1>Infos.obj : error LNK2005: "public: static void __cdecl curlpp::InfoTypeConverter<class std::list<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > >::get(class curlpp::Easy &,enum CURLINFO,class std::list<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > &)" (?get#?$InfoTypeConverter#V?$list#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##std###curlpp##SAXAAVEasy#2#W4CURLINFO##AAV?$list#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##std###Z) already defined in Info.obj
1>Infos.obj : error LNK2005: "public: static void __cdecl curlpp::InfoTypeConverter<long>::get(class curlpp::Easy &,enum CURLINFO,long &)" (?get#?$InfoTypeConverter#J#curlpp##SAXAAVEasy#2#W4CURLINFO##AAJ#Z) already defined in Info.obj
1>Infos.obj : error LNK2005: "public: static void __cdecl curlpp::InfoTypeConverter<double>::get(class curlpp::Easy &,enum CURLINFO,double &)" (?get#?$InfoTypeConverter#N#curlpp##SAXAAVEasy#2#W4CURLINFO##AAN#Z) already defined in Info.obj
1>Options.obj : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class curlpp::OptionTrait<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,10002> const &)" (??6#YAAAV?$basic_ostream#DU?$char_traits#D#std###std##AAV01#ABV?$OptionTrait#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##$0CHBC##curlpp###Z) already defined in Option.obj
1> Creating library DebugDynamic\curlpp.lib and object DebugDynamic\curlpp.exp
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_global_init referenced in function "void __cdecl curlpp::initialize(long)" (?initialize#curlpp##YAXJ#Z)
1>cURLpp.obj : error LNK2019: unresolved external symbol __imp__curl_global_cleanup referenced in function "void __cdecl curlpp::terminate(void)" (?terminate#curlpp##YAXXZ)
1>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)
1>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)
1>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)
1>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)
1>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)
1>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)
1>Form.obj : error LNK2019: unresolved external symbol __imp__curl_formfree referenced in function "public: void __thiscall curlpp::HttpPost::clear(void)" (?clear#HttpPost#curlpp##QAEXXZ)
1>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)
1>Info.obj : error LNK2019: unresolved external symbol __imp__curl_easy_getinfo referenced in function "public: void __thiscall curlpp::internal::CurlHandle::getInfo<char *>(enum CURLINFO,char * &)" (??$getInfo#PAD#CurlHandle#internal#curlpp##QAEXW4CURLINFO##AAPAD#Z)
1>Infos.obj : error LNK2001: unresolved external symbol __imp__curl_easy_getinfo
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_init referenced in function "public: __thiscall curlpp::Multi::Multi(void)" (??0Multi#curlpp##QAE#XZ)
1>Multi.obj : error LNK2019: unresolved external symbol __imp__curl_multi_cleanup referenced in function "public: __thiscall curlpp::Multi::~Multi(void)" (??1Multi#curlpp##QAE#XZ)
1>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)
1>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)
1>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)
1>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)
1>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)
1>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)
1>Option.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)
1>Options.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt
1>CurlHandle.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt
1>OptionSetter.obj : error LNK2001: unresolved external symbol __imp__curl_easy_setopt
1>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)
1>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)
1>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)
1>CurlHandle.obj : error LNK2019: unresolved external symbol __imp__curl_easy_duphandle referenced in function "public: class std::auto_ptr<class curlpp::internal::CurlHandle> __thiscall curlpp::internal::CurlHandle::clone(void)const " (?clone#CurlHandle#internal#curlpp##QBE?AV?$auto_ptr#VCurlHandle#internal#curlpp###std##XZ)
1>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)
1>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)
1>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)
1>DebugDynamic\curlpp.dll : fatal error LNK1120: 27 unresolved externals
1>Project : warning PRJ0018 : The following environment variables were not found:
1>$(BOOST_PATH)
1>Build log was saved at "file://c:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\DebugDynamic\BuildLog.htm"
1>curlpp - 37 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Will this ever end?
Additional Libraries now looks like this:
"C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\lib\Debug";
"C:\Program Files (x86)\CodeBlocks\MinGW\lib";
"C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\lib";
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib";
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib"
And the includes:
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Include";
"C:\Users\admin\Downloads\curl-7.22.0\curl-7.22.0\include";
.\;
include\curlpp;
include;
"$(BOOST_PATH)"
What is BOOST PATH?
And also, to get rid of the "libcurl.lib not found" error, I opened the project I found in curl-7.22.0 and compiled it, but that means libcurl.lib is in the "lib\Debug" folder which I included as you can see above, did I do that correctly?
UPDATE3:
I noticed a file called create-vc-solution.bat so, after downloading "sed" for windows, I tried creating a vc solution for VS9 (There was no option for 10) hoping that would work, but here's what I get when I open the solution file that creates in VS2010:
Converting project file 'C:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\curlpp.examples.VC9.vcproj'.
File 'C:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\curlpp.examples.VC9.vcproj' was not found.
Project upgrade failed.
Converting project file 'C:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\curlpp.VC9.vcproj'.
File 'C:\Users\admin\Downloads\curlpp-0.7.3\curlpp-0.7.3\curlpp.VC9.vcproj' was not found.
Project upgrade failed.
curlpp.examples.VC9.vcproj and curlpp.VC9.vcproj were never even created. Has curlpp been tested at all? By anyone? I'm starting to think this isn't even my fault anymore.

I see you are compiling curlpp into dynamic library. Is that what you wanted? And you should add libcurl.lib to your linker input.

Related

VTK - Migrating from 6.1 to 8.2 [2]

Please see this post:
VTK - Migrating from 6.1 to 8.2
I setup all settings, and I get only 3 errors, and I cannot get rid of them for days:
1>------ Build started: Project: MyApp, Configuration: Debug x64 ------
1> Creating library F:\MyApp\x64\Debug\MyApp.lib and object F:\MyApp\x64\Debug\MyApp.exp
1>MyAppView.obj : warning LNK4217: locally defined symbol ??0vtkMFCWindow##QEAA#PEAVCWnd###Z (public: __cdecl vtkMFCWindow::vtkMFCWindow(class CWnd *)) imported in function "protected: __int64 __cdecl CMyAppView::OnPostInit(unsigned __int64,__int64)" (?OnPostInit#CMyAppView##IEAA_J_K_J#Z)
1>MyAppView.obj : warning LNK4217: locally defined symbol ??1vtkMFCWindow##UEAA#XZ (public: virtual __cdecl vtkMFCWindow::~vtkMFCWindow(void)) imported in function "public: virtual void * __cdecl vtkMFCWindow::`scalar deleting destructor'(unsigned int)" (??_GvtkMFCWindow##UEAAPEAXI#Z)
1>VTKView.obj : warning LNK4217: locally defined symbol ?DrawDC#vtkMFCWindow##QEAAXPEAVCDC###Z (public: void __cdecl vtkMFCWindow::DrawDC(class CDC *)) imported in function "public: virtual void __cdecl CVTKView::OnDraw(class CDC *)" (?OnDraw#CVTKView##UEAAXPEAVCDC###Z)
1>vtkRenderingOpenGL2-8.2.lib(vtkOpenGLState.obj) : error LNK2019: unresolved external symbol __imp_SymGetLineFromAddr64 referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getProgramStack(void)" (?getProgramStack##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
1>vtkRenderingOpenGL2-8.2.lib(vtkOpenGLState.obj) : error LNK2019: unresolved external symbol __imp_SymInitialize referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getProgramStack(void)" (?getProgramStack##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
1>vtkRenderingOpenGL2-8.2.lib(vtkOpenGLState.obj) : error LNK2019: unresolved external symbol __imp_SymFromAddr referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getProgramStack(void)" (?getProgramStack##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
1>F:\MyApp\x64\Debug\MyApp.exe : fatal error LNK1120: 3 unresolved externals
1>Done building project "MyApp.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
cand you give a hint to gt away of these links errors ?
Link your binary with dbghelp.lib
e.g. add something like the following line into your CMakeLists.txt if you are using CMake
target_link_libraries(${project_name} PRIVATE dbghelp.lib)
or add it into into project (Linker/Input/Additional Dependencies) if you are not using CMake
or the add the following into main.cpp somewhere below includes
#pragma comment(lib, "dbghelp.lib") //untested
Possibly turning off VTK error logging in VTK CMake may help as well (not sure)
VTK_REPORT_OPENGL_ERRORS [ ]

yaml-cpp unresolved external symbol error

I'm trying to build a solution in Visual Studio 2017. And I get these errors:
1>------ Build started: Project: UA_Parser, Configuration: Release x64 ------
1>UaParserTest.cpp
1>UaParser.obj : error LNK2001: unresolved external symbol "class YAML::Node __cdecl YAML::LoadFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?LoadFile#YAML##YA?AVNode#1#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl YAML::InvalidNode::~InvalidNode(void)" (??1InvalidNode#YAML##UEAA#XZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl YAML::Exception::~Exception(void)" (??1Exception#YAML##UEAA#XZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl YAML::RepresentationException::~RepresentationException(void)" (??1RepresentationException#YAML##UEAA#XZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl YAML::BadConversion::~BadConversion(void)" (??1BadConversion#YAML##UEAA#XZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl YAML::BadSubscript::~BadSubscript(void)" (??1BadSubscript#YAML##UEAA#XZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: class YAML::detail::node & __cdecl YAML::detail::memory::create_node(void)" (?create_node#memory#detail#YAML##QEAAAEAVnode#23#XZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "private: void __cdecl YAML::detail::node_data::convert_to_map(class std::shared_ptr<class YAML::detail::memory_holder>)" (?convert_to_map#node_data#detail#YAML##AEAAXV?$shared_ptr#Vmemory_holder#detail#YAML###std###Z)
1>UaParser.obj : error LNK2001: unresolved external symbol "private: void __cdecl YAML::detail::node_data::insert_map_pair(class YAML::detail::node &,class YAML::detail::node &)" (?insert_map_pair#node_data#detail#YAML##AEAAXAEAVnode#23#0#Z)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: class YAML::detail::node_iterator_base<class YAML::detail::node> __cdecl YAML::detail::node_data::end(void)" (?end#node_data#detail#YAML##QEAA?AV?$node_iterator_base#Vnode#detail#YAML###23#XZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: class YAML::detail::node_iterator_base<class YAML::detail::node> __cdecl YAML::detail::node_data::begin(void)" (?begin#node_data#detail#YAML##QEAA?AV?$node_iterator_base#Vnode#detail#YAML###23#XZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: void __cdecl YAML::detail::node_data::set_scalar(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?set_scalar#node_data#detail#YAML##QEAAXAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: void __cdecl YAML::detail::node_data::set_null(void)" (?set_null#node_data#detail#YAML##QEAAXXZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: void __cdecl YAML::detail::node_data::mark_defined(void)" (?mark_defined#node_data#detail#YAML##QEAAXXZ)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > YAML::detail::node_data::empty_scalar" (?empty_scalar#node_data#detail#YAML##2V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##A)
1>UaParser.obj : error LNK2001: unresolved external symbol "public: void __cdecl YAML::detail::memory_holder::merge(class YAML::detail::memory_holder &)" (?merge#memory_holder#detail#YAML##QEAAXAEAV123##Z)
1>C:\bmetric\C++ Projects\UA_Parser\x64\Release\UA_Parser.exe : fatal error LNK1120: 16 unresolved externals
1>Done building project "UA_Parser.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I have a feeling they can be solved by linking, but I am not sure what to link (the precise folder).
So far, I have built the yaml-cpp as described on github. Also, I have added the ..\yaml-cpp\include folder in the Additional Include Directories from Configuration Properties >> C/C++ >> General and tried to include in the Additional Library Directories (Linker) various folders, unsuccessfully.
Never used YAML before. And I don't link stuff often.
I was getting the unresolved external symbols errors because I was including #include <yaml-cpp/node/node.h>, which is what Resharper recommended me(and it's is correct 99.9% of the time). In this case it's a wrong header and what I should have been including is: #include <yaml-cpp/yaml.h>.
I fixed my includes in my files and it built successfully.

Unable to build *.dll for webrtc using ninja for windows machine

I need dll files as output for windows machines. Default GN configuration creates lib files only. So I changed target_type from static_library to loadable_module in webrtc.gni, but Ninja was not able to build it. Here is error snapshot
ninja: Entering directory `out\Release12'
[626/3359] LINK_MODULE(DLL) webrtc_common.dll webrtc_common.dll.pdb
FAILED: webrtc_common.dll webrtc_common.dll.pdb
C:/webRTC/depot_tools/python276_bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /DLL /OUT:./webrtc_common.dll /PDB:./webrtc_common.dll.pdb #./webrtc_common.dll.rsp
common_types.obj : error LNK2019: unresolved external symbol "public: __cdecl rtc::FatalMessage::FatalMessage(char const *,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (??0FatalMessage#rtc##QEAA#PEBDHPEAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function "public: unsigned int __cdecl webrtc::BitrateAllocation::GetBitrate(unsigned __int64,unsigned __int64)const " (?GetBitrate#BitrateAllocation#webrtc##QEBAI_K0#Z)
common_types.obj : error LNK2019: unresolved external symbol "public: __cdecl rtc::FatalMessage::~FatalMessage(void)" (??1FatalMessage#rtc##QEAA#XZ) referenced in function "public: unsigned int __cdecl webrtc::BitrateAllocation::GetBitrate(unsigned __int64,unsigned __int64)const " (?GetBitrate#BitrateAllocation#webrtc##QEBAI_K0#Z)
./webrtc_common.dll : fatal error LNK1120: 2 unresolved externals
[631/3359] CC obj/third_party/yasm/yasm/nasm-pp.obj
ninja: build stopped: subcommand failed.
Thanks,
Shashi

Linker error when trying to use ImageMagick as static libraries with Visual Studio compiler

This question has already been asked here, but since I have many more details to provide, I think it is best to start with a new question.
I have trouble linking the ImageMagick lib files in my program that uses the Visual Studio MSVC 2015 compiler. Here are the steps I have followed:
I have compiled the static MT runtimes by using the "configure.exe" utility and built in Visual Studio the solution it generated, "VisualStaticMT.sln". This creates lib files such as "CORE_RL_Magick++_.lib" in C:\ImageMagick-6.9.3-2\VisualMagick\lib.
In my C++11 program, the configuration relevant to ImageMagick is (I use QtCreator, but with the MSVC2015 compiler):
INCLUDEPATH += \
C:\ImageMagick-6.9.3-2\ImageMagick\Magick++\lib \
C:\ImageMagick-6.9.3-2\ImageMagick
LIBS += \
-lC:\ImageMagick-6.9.3-2\VisualMagick\lib\CORE_RL_Magick++_ \
-lC:\ImageMagick-6.9.3-2\VisualMagick\lib\CORE_RL_wand_ \
-lC:\ImageMagick-6.9.3-2\VisualMagick\lib\CORE_RL_magick_
QMAKE_CXXFLAGS += \
-DMAGICKCORE_HDRI_ENABLE=0 \
-DMAGICKCORE_QUANTUM_DEPTH=16
A piece of the program contains:
#include <Magick++.h>
...
Magick::Image img;
img = Magick::Image(filename);
When compiling I get link errors:
movie.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Magick::Image::Image(void)" (__imp_??0Image#Magick##QAE#XZ) referenced in function "public: __thiscall Frame<unsigned char>::Frame<unsigned char>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0?$Frame#E##QAE#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
movie.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Magick::Image::Image(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0Image#Magick##QAE#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function "public: __thiscall Frame<unsigned char>::Frame<unsigned char>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0?$Frame#E##QAE#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
movie.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Magick::Image::~Image(void)" (__imp_??1Image#Magick##UAE#XZ) referenced in function "public: __thiscall Frame<unsigned char>::Frame<unsigned char>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0?$Frame#E##QAE#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
movie.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Magick::Image & __thiscall Magick::Image::operator=(class Magick::Image const &)" (__imp_??4Image#Magick##QAEAAV01#ABV01##Z) referenced in function "public: __thiscall Frame<unsigned char>::Frame<unsigned char>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0?$Frame#E##QAE#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
movie.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Magick::Image::write(long,long,unsigned int,unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum MagickCore::StorageType,void *)" (__imp_?write#Image#Magick##QAEXJJIIABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##W4StorageType#MagickCore##PAX#Z) referenced in function "public: __thiscall Frame<unsigned char>::Frame<unsigned char>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0?$Frame#E##QAE#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
movie.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct MagickCore::_Image const * __thiscall Magick::Image::constImage(void)const " (__imp_?constImage#Image#Magick##QBEPBU_Image#MagickCore##XZ) referenced in function "public: __thiscall Frame<unsigned char>::Frame<unsigned char>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0?$Frame#E##QAE#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
release\corr.exe : fatal error LNK1120: 6 unresolved externals
The "dllimport" error suprises me, as I think there should be no DLL involved with the "static MT runtimes" I am using.
Any idea on how I could solve the problem?
Thanks.
EDIT
A few more things I have tried:
Linking the libraires with the lines below in main.cpp gave the same errors:
#pragma comment(lib, "CORE_RL_Magick++_.lib")
#pragma comment(lib, "CORE_RL_wand_.lib")
#pragma comment(lib, "CORE_RL_magick_.lib")
I tried to add all the 27 lib files located in C:\ImageMagick-6.9.3-2\VisualMagick\lib. If I exclude CORE_RL_exr_.lib, I get the same error. If I include it, I get additional errors that suggest this file should not be added:
CORE_RL_exr_.lib(IexBaseExc.obj):-1: error: LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in main.obj
probably you are missing some library files. because your program is unable to link library file that's why it gives linker error. Try to link lib file externally .. try this code before main method..
#pragma comment(lib, "CORE_DB_magick++.lib")
you can download this lib file from given below link.
https://github.com/moravianlibrary/Open-DPI-Detector/tree/master/OpenDpiDetector/Libraries/ImageMagick-6.7.6/VisualMagick/lib
To be able to link your app with static build of ImageMagick you have to do couple of tricks (as for ImageMagick-7.0.8-11):
add preprocessor definition STATIC_MAGICK to your visual studio project
add missing input library CORE_DB_croco_.lib/CORE_RL_croco_.lib in the Linker->Input (other libs ImageMagick adds automatically via #pragma)
rename CORE_XX_liblzma_.pdb -> CORE_XX_lzma_.lib (ImageMagick links this lib with other name, probably bug), XX = RL or DB
The answer to linking the ImageMagick static libraries is to ensure you link all the dependant static libraries as well!
Once you have compiled the solution for ImageMagick static libraries, go to the 'VisualMagick' folder (within the ImageMagick cloned repository) then to to the 'lib' folder there you will see all the *_DB_*.lib and *_RL_*.lib files for Debug and Release.
You need to include those names in the 'Additional Dependencies' section for both Release and Debug.
Another key aspect is to ensure the libraries are built by the same compiler for the same platform architecture as your own application .. (WIN32 or x64).

error LNK2019: unresolved external symbol "public:

I am creating an torrent application using libtorrent in VS 2008. I tried the example given in the link http://www.rasterbar.com/products/libtorrent/examples.html
BUt it is showing me these error....how to solve them?
Linking...
main.obj : error LNK2019: unresolved external symbol "public: __thiscall libtorrent::torrent_info::~torrent_info(void)" (??1torrent_info#libtorrent##QAE#XZ) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: __thiscall libtorrent::torrent_info::torrent_info(struct libtorrent::lazy_entry const &)" (??0torrent_info#libtorrent##QAE#ABUlazy_entry#1##Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "class std::basic_ostream > & __cdecl libtorrent::operator<<(class std::basic_ostream > &,struct libtorrent::lazy_entry const &)" (??6libtorrent##YAAAV?$basic_ostream#DU?$char_traits#D#std###std##AAV12#ABUlazy_entry#0##Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "int __cdecl libtorrent::lazy_bdecode(char const *,char const *,struct libtorrent::lazy_entry &,int)" (?lazy_bdecode#libtorrent##YAHPBD0AAUlazy_entry#1#H#Z) referenced in function _main
main.obj : error LNK2019: unresolved external symbol "public: void __thiscall libtorrent::lazy_entry::clear(void)" (?clear#lazy_entry#libtorrent##QAEXXZ) referenced in function "public: __thiscall libtorrent::lazy_entry::~lazy_entry(void)" (??1lazy_entry#libtorrent##QAE#XZ)
main.obj : error LNK2019: unresolved external symbol "void __cdecl libtorrent::to_hex(char const *,int,char *)" (?to_hex#libtorrent##YAXPBDHPAD#Z) referenced in function "class std::basic_ostream > & __cdecl libtorrent::operator<<(class std::basic_ostream > &,class libtorrent::big_number const &)" (??6libtorrent##YAAAV?$basic_ostream#DU?$char_traits#D#std###std##AAV12#ABVbig_number#0##Z)
main.obj : error LNK2019: unresolved external symbol "public: struct libtorrent::peer_request __thiscall libtorrent::file_storage::map_file(int,__int64,int)const " (?map_file#file_storage#libtorrent##QBE?AUpeer_request#2#H_JH#Z) referenced in function "public: struct libtorrent::peer_request __thiscall libtorrent::torrent_info::map_file(int,__int64,int)const " (?map_file#torrent_info#libtorrent##QBE?AUpeer_request#2#H_JH#Z)
C:\Users\photoshop3\Documents\Visual Studio 2008\Projects\Lib2\Debug\Lib2.exe : fatal error LNK1120: 7 unresolved externals
The .lib is not included in your project. Make sure you are linking it in;
Configuration Properties -> Linker -> Input -> Additional Dependencies
Another altnerative is to simply copy the .lib to your project folder but don't, it's bound to create problems later on.
Sometimes the .lib is not shipped with the library, so you need to compile it yourself.
The README will tell you this. If this is the case, they usually ship with a .sln file you can open and the just compile it into a .lib file which you then reference in your main application, as I wrote above
Have you added the path of header files in the "Configuration Properties" --> "C/C++“ --> "General" --> "Additional Include Directories"?
The link gives you only the sources (including headerfiles) of libtorrent. You should compile this sources to get a .lib file. Add this .lib file to your client:
Configuration Properties/Linker/Input -> Additional Dependencies: libtorrent-rasterbar.lib
The best starting point for compiling should be the README file.
public: isn't the unresolved symbol. It's just there because the linker it trying to tell you that (most) of the unresolved symbols are public member functions.
It looks like you've included the header for "libtorrent", but not linked to the "libtorrent" library.
You have probably not linked with the torrent library or specified the wrong path to it so that the linker cannot find it.
If the input libraries are of 32bit and your are using them in building a 64bit it might be one of the reasons
For me, I had it included in my project, but it turned out that it was a plugin that was designed to not create an instance of in my unit test.