首先,请原谅我对 C++ 的了解不足。我是一个真正的初学者!
我正在尝试在 MS VS2005 上编译一个 C++ 代码。对于以下代码,我收到如下链接器错误:-
在一个函数(某些类方法)定义中,它具有用于内存分配的代码,例如:
CDecoderUnit *du = new CDecoderUnit(); //<<error is shown at this line
这个 CDecoderUnit 是一个在头文件中定义的类,类似于
class CDecoderUnit : public IPrepareDecoderUnit
{
CDecoderUnit();
~CDecoderUnit();
...
...
other class definition.
..
..
}
实际错误是:-
错误 LNK2019:未解析的外部符号“public:__thiscall CDecoderUnit::CDecoderUnit(void)”(??0CDecoderUnit@@QAE@XZ) 在函数“private:long __thiscall CLSDEnc::CreateIPrepareDecoderUnit(struct IPrepareDecoderUnit * &)const”中引用(? CreateIPrepareDecoderUnit@CLSDEnc@@ABEJAAPAUIPrepareDecoderUnit@@@Z) lsdenc.obj
谁能指点我解决这个问题?