在我的VC++代码,这是罚款早些时候编译,我添加了一个函数X()是这样的:错误LNK2001:无法解析的外部符号C++
In the file BaseCollection.h
class Base
{
// code
virtual HRESULT X();
//code
};
IN the file DerivedCollection.h
class Derived:public Base
{
HRESULT X();
}
In the file DerivedCollection.cpp
HRESULT Derived::X
{
// definition of Derived here.
}
在.cpp文件中已经包含了头文件也正常。 但我仍没有什么原因,我收到链接错误理解:
error LNK2001: unresolved external symbol "public: virtual long __thiscall Base::X()" ([email protected]@@[email protected])
我真的很努力地修复这个bug。任何人都可以帮助我解决这个问题。 非常感谢。
是的,谢谢我摆脱了链接错误。 :)非常感谢你如此迅速的回应。 – codeLover 2012-04-23 11:34:39