1

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

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

感谢您的帮助。

4

2 回答 2

4

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

于 2013-10-29T19:22:00.590 回答
3

如果您阅读该消息,它会说:

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

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

clsJoinBigUnsignedCharMap::Content(void)

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

于 2013-10-29T19:23:52.533 回答