PDA

View Full Version : Debug errors 'vtable for...' , undefined references to destructor ????



tonnot
27th October 2010, 08:58
I'm trying to test a component (led from 3electrons).
This is the errors I get, and I dont understand nothing.....
Pleas help...

debug/moc_led.o:moc_led.cpp:(.rdata$_ZTV3Led[vtable for Led]+0x14): undefined reference to `Led::~Led()'
debug/moc_led.o:moc_led.cpp:(.rdata$_ZTV3Led[vtable for Led]+0x18): undefined reference to `Led::~Led()'
debug/moc_led.o:moc_led.cpp:(.rdata$_ZTV3Led[vtable for Led]+0xf4): undefined reference to `non-virtual thunk to Led::~Led()'
debug/moc_led.o:moc_led.cpp:(.rdata$_ZTV3Led[vtable for Led]+0xf8): undefined reference to `non-virtual thunk to Led::~Led()'

saa7_go
27th October 2010, 09:09
you need to implement your Led destructor.



class Led
{
...
~Led();
};

Led::~Led()
{
// do something
}

tonnot
27th October 2010, 09:58
Nothing....
This led component are extending another widget. This one has it's own destructor.
Initially the code was virtual ~Led();
I can't compile it with any combination.
The more strange thing is that there is another component (wallclock) that has not destructor ?....
(This widgets are part of analogwidgets from 3electrons, I'm thinking about contact to author directly ).
Thanks

Added after 14 minutes:

Solved with :
virtual ~Led(){}
But I dont understand that the other widget (wallclock) works if it has not destructor and is extending the same widget that 'led'.
Thanks any way.

wysota
27th October 2010, 10:09
The other widget works probably because you didn't declare a destructor for it so the compiler provided one. But here since you did declare the destructor, you need to implement it.