【发布时间】:2009-07-16 09:47:58
【问题描述】:
首先,请原谅我对 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
谁能指点我解决这个问题?
【问题讨论】:
-
你能标出正确的答案吗?
标签: c++ linker-errors