开发者

Qt : how to debug and get the source of signal and slots linking error’s

开发者 https://www.devze.com 2023-03-17 10:10 出处:网络
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 th

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 m开发者_高级运维ore 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


Make sure the header the TestDialog is declared in (say testdialog.h) is added to the HEADERS section in your .pro file:

HEADERS += testdialog.h

Then re-run qmake.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号