对于给定的类构造函数和析构函数,我遇到了一个与缺少 vtable 有关的非常奇怪的错误。请帮我解决这个问题。
架构 i386 的未定义符号:
"vtable for A", referenced from:
A::A() in A.o
A::~MissionController() in A.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
代码片段;
.h 文件:
class A: public B
public:
A();
~A();
};
.cpp 文件..
A::A()
{
}
A::~A()
{
}