C ++ VS2010未解析的符号

时间:2013-10-29 19:18:34

标签: c++ visual-studio-2010 linker-errors

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

"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也不知道。

感谢您的帮助。

2 个答案:

答案 0 :(得分:4)

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

答案 1 :(得分:3)

如果你看到它说的信息:

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

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

clsJoinBigUnsignedCharMap::Content(void)

链接器无法与clsJoinBigUnsignedCharMap::Content链接,它没有已编译的代码。