How to debug and get the source of signal and slots linking error's



  • Hi sometimes when i change large code base written in Qt , after compilnig it im getting linking errors that talking about something wrong in "metaObject" but i have no idea what is the source of the problem , how can i get more info from this error :
    @1>Linking...
    1>TestDialog.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall TestDialog::metaObject(void)const " (?metaObject@TestDialog@@UBEPBUQMetaObject@@XZ)
    1>TestDialog.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall TestDialog::qt_metacast(char const *)" (?qt_metacast@TestDialog@@UAEPAXPBD@Z)
    1>TestDialog.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall TestDialog::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@TestDialog@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
    1>TestDialog.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const TestDialog::staticMetaObject" (?staticMetaObject@TestDialog@@2UQMetaObject@@B)
    1>debug\TestApp.exe : fatal error LNK1120: 4 unresolved externals@



  • Your header isn't moc'ed. The VS plug-in probably didn't detect the Q_OBJECT macro properly. Remove, add, rebuild.



  • if your use qmake, please run it again.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.