Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

warning: can't find linker symbol for virtual table

150 views
Skip to first unread message

Chengyi Wu

unread,
Sep 24, 2009, 8:31:27 PM9/24/09
to
Hi,

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! ]

0 new messages