Results 1 to 4 of 4

Thread: Debug errors 'vtable for...' , undefined references to destructor ????

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Debug errors 'vtable for...' , undefined references to destructor ????

    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()'

  2. #2
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: Debug errors 'vtable for...' , undefined references to destructor ????

    you need to implement your Led destructor.

    Qt Code:
    1. class Led
    2. {
    3. ...
    4. ~Led();
    5. };
    6.  
    7. Led::~Led()
    8. {
    9. // do something
    10. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Debug errors 'vtable for...' , undefined references to destructor ????

    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.
    Last edited by tonnot; 27th October 2010 at 09:58.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Debug errors 'vtable for...' , undefined references to destructor ????

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qt Undefined Reference to vtable
    By ctote in forum Qt Programming
    Replies: 18
    Last Post: 24th February 2010, 22:24
  2. Replies: 0
    Last Post: 19th November 2009, 19:02
  3. Undefined reference to 'vtable for XXX'
    By Sheng in forum Qt Programming
    Replies: 4
    Last Post: 17th October 2008, 15:59
  4. QWebView undefined references
    By xtreme in forum Qt Programming
    Replies: 2
    Last Post: 28th July 2008, 08:08
  5. undefined reference to vtable
    By renjithmamman in forum Qt Programming
    Replies: 5
    Last Post: 2nd July 2006, 04:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.