I'm using Eclipse 3.5 CDT and GDB 6.8-debian.
I got this warning "warning: can't find linker symbol for virtual
table for 'xxx' value" when debugging the following code:
class Instrument {
protected:
string _name;
public:
Instrument(string name): _name(name){ cout << this->_name << endl;}
virtual ~Instrument() { cout << "~Instrument()\n";}
};
class violin: public Instrument{
public:
violin(string name):Instrument(name){cout<< this->_name<<endl;}
~violin(){cout << "~violin\n";}
};
int main(void){
Instrument* ins = new violin("violin");
delete ins;
}
It's a simple code, but I always get this warning, I hope some one can
help me understand the underlying reason for this.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]