Qt: Signals and slots Error: undefined reference to `vtable for

前端 未结 5 746
走了就别回头了
走了就别回头了 2020-12-03 16:54

Following example from this link: http://developer.kde.org/documentation/books/kde-2.0-development/ch03lev1sec3.html

#include 
#include 

        
5条回答
  •  温柔的废话
    2020-12-03 17:33

    It looks like moc doesn't generate code for your QObject because you declare it in the .cpp file. The easiest way to fix that is to move the declaration of MyWindow to a header, and add the header to the HEADERS list, in the .pro file:

    HEADERS += yourheader.h 
    

    Then rerun qmake.

    (Please note that the KDE 2.0 book you look at is vastly outdated)

提交回复
热议问题