本文介绍了链接器错误LNK2019在C ++中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图构建一个C ++程序,并继续得到这个错误,当我尝试定义一个新的功能和构建它。我解决了很少的他们,直到现在,但花了很多时间来详细了解错误。错误我现在得到如下:

I am trying to build a C++ program and keep on getting this error 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:

错误22错误LNK2019:未解析的外部符号public:__thiscall xmlElements :: operator class std :: basic_string,class std: :functionpublic(引用的):allocator>(void)(?? BxmlElements @@ QAE?AV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@ XZ) :class xmlTags& __thiscall xmlTags :: addSib(class xmlElements)(?addSib @ xmlTags @@ QAEAAV1 @ VxmlElements @@@ Z)

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)

错误25错误LNK2019:未解析的外部符号public:__thiscall xmlElements :: operator class std :: basic_string,class std :: allocator>(void)(?? BxmlElements @@ QAE?AV?$ basic_string @ DU?$ char_traits @ D @ std @@在函数public:class xmlTags& __thiscall xmlTags :: addSib(class xmlElements)(?addSib @ xmlTags @@ QAEAAV1 @ VxmlElements @@@ Z)中引用的V $ $ allocator @ D @ 2 @@ std @

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)

错误23错误LNK2019:未解析的外部符号public:__thiscall xmlTags :: xmlTags(void)(?? 0xmlTags @@ QAE @ XZ) :static void __cdecl xmlTags :: makeDoc(void)(?makeDoc @ xmlTags @@ SAXXZ)

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)

错误26错误LNK2019:未解析的外部符号public:__thiscall xmlTags: xmlTags :: makeDoc(void)(?makeDoc @ xmlTags @@ SAXXZ)在函数public:static void __cdecl xmlTags :: makeDoc(void)中引用的xmlTags(void)(?? 0xmlTags @@ QAE @ XZ)

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?

推荐答案

要使用库:
转到 Project /< projectname>属性/配置属性/ CC ++ /其他包含目录,并输入库的头文件所在的目录。

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.

然后在配置属性/链接器/常规/附加库目录下输入lib目录的位置。

Then also under Configuration Properties/Linker/General/Additional Library Directories enter in the location of the lib directory.

然后在配置属性/链接器/输入/附加依赖项下将lib文件的名称lib目录。

Then under Configuration Properties/Linker/Input/Additional dependencies put the name(s) of the lib files in the lib directory.

这篇关于链接器错误LNK2019在C ++中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-16 21:26