求教C++构造函数问题
class A
{
public:
A();
virtural ~A();
};
class B
{
public:
B();
B(string s, int a, int b);
~B();
private:
int m_a;
int m_b;
string m_str;
};
B::B()
{
m_a = 0;
m_b = 0;
m_str = "";
}
B::B(string s, int a, int b):m_str(s), m_a(a), m_b(b)
{
}
在两个构造函数实现处提示:
undefined reference to `‘vtable for B'
求大神帮忙看下是哪里出问题了...
不胜感激
[解决办法]
~B();
也要定义吧?
或者干脆去掉
[解决办法]
lz参考
http://www.daniweb.com/software-development/cpp/threads/114299