Linker error LNK2019 in C++ [duplicate]
I am trying to build a C++ program and keep on getting LNK2019 link errors whenever I try defining a new function and building it. I resolved few of them till now, but spend a lot of time to understand the error in detail. Errors I am getting now are as per below:
Error 22 error LNK2019: unresolved external symbol "public: __thiscall xmlElements::operator class std::basic_string,class std::allocator >(void)" (??BxmlElements@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: class xmlTags & __thiscall xmlTags::addSib(class xmlElements)" (?addSib@xmlTags@@QAEAAV1@VxmlElements@@@Z)
Error 25 error LNK2019: unresolved external symbol "public: __thiscall xmlElements::operator class std::basic_string,class std::allocator >(void)" (??BxmlElements@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: class xmlTags & __thiscall xmlTags::addSib(class xmlElements)" (?addSib@xmlTags@@QAEAAV1@VxmlElements@@@Z)
Error 23 error LNK2019: unresolved external symbol "public: __thiscall xmlTags::xmlTags(void)" (??0xmlTags@@QAE@XZ) referenced in function "public: static void __cdecl xmlTags::makeDoc(void)" (?makeDoc@xmlTags@@SAXXZ)
Error 26 error LNK2019: unresolved external symbol "public: __thiscall xmlTags::xmlTags(void)" (??0xmlTags@@QAE@XZ) referenced in function "public: static void __cdecl xmlTags::makeDoc(void)" (?makeDoc@xmlTags@@SAXXZ)
Going through various forums I understood that I need to add some library name and its path, but I am bad at library thing. From where can I get its name and the path?
To use a library:
go under Project/<projectname>Properties/Configuration Properties/CC++/Additional Include Directories
and enter in the directory where the header files for the library are.
Then also under Configuration Properties/Linker/General/Additional Library Directories
enter in the location of the lib directory.
Then under Configuration Properties/Linker/Input/Additional dependencies
put the name(s) of the lib files in the lib directory.
精彩评论