【QT 問題】undefined reference to 'vtable for' 或者 'staticMetaObject' is not a member of 'QBaseObject'

undefined reference to ‘vtable for’

參考鏈接:https://blog.csdn.net/wangzhiqian7hao/article/details/83446696#commentBox
Qt Creator可能沒有反應過來你添加的代碼。需要使用Qt Creator的
Build->clean all 然後一定要刪除build-××××-Debug下面的Makefile文件
然後使用Build->Build All
就額可以了。

‘staticMetaObject’ is not a member of ‘QBaseObject’

參考鏈接:https://wenku.baidu.com/view/a40b258c6529647d27285202.html

一般是因爲你採用了多繼承的方式,繼承順序需要調整。
例如將
class QRTUbloxPPPModel: public QBaseObject, public QObject
調整爲:
class QRTUbloxPPPModel: public QObject, public QBaseObject
就可以了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章