C++ VS2010 未解析符号

C++ VS2010 Unresolved symbol

本文关键字:符号 VS2010 C++      更新时间:2023-10-16

我真的很讨厌编译器告诉我的这个问题

"err LNK2019: Reference to unresolved external symbol".

与其他编译器错误不同,我无法通过双击它来跳转到此问题。

总是需要花费大量的时间来弄清楚我做错了什么。

例如,从错误消息

Error   9   error LNK2019: Reference to unresolved symbol ""public: class std::vector<unsigned char,class std::allocator<unsigned char> > & __thiscall clsJoinBigUnsignedCharMap::Content(void)" (?Content@clsJoinBigUnsignedCharMap@@QAEAAV?$vector@EV?$allocator@E@std@@@std@@XZ)" in Funktion ""private: void __thiscall CCompiler::pSerializeJoinBigUnsignedCharMap(class clsJoinBigUnsignedCharMap &,struct _iobuf *)" (?pSerializeJoinBigUnsignedCharMap@CCompiler@@AAEXAAVclsJoinBigUnsignedCharMap@@PAU_iobuf@@@Z)".    m:compiler.obj voice

我根本看不到我应该在哪里寻找错误。

我在这里错过了什么吗?我没有看到错误的位置,并且我无法通过双击它跳转到问题的事实向我表明VS2010也不知道。

谢谢你的帮助。

您的CCompiler::pSerializeJoinBigUnsignedCharMap(来自compiler.obj)正在使用在标头中定义但未在任何链接源文件中实现的方法(clsJoinBigUnsignedCharMap::Content())。

如果您阅读消息,它说:

in Funktion ""private: void __thiscall CCompiler::pSerializeJoinBigUnsignedCharMap(class clsJoinBigUnsignedCharMap &,struct _iobuf *)"

所以在函数CCompiler::pSerializeJoinBigUnsignedCharMap中,有一个未引用的符号

clsJoinBigUnsignedCharMap::Content(void)
链接

器不能与clsJoinBigUnsignedCharMap::Content链接,它没有编译的代码。