开发者

Linker error LNK2019 in C++ [duplicate]

This question already has answers here: What is an undefined reference/unresolved external symbol error and how do I fix it? 开发者_开发百科 (39 answers) Closed 5 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜