【发布时间】:2014-06-02 14:09:22
【问题描述】:
我正在尝试为我的 Qt 页面实现多级继承。
class MyPage1: public QWizardPage {
Q_OBJECT
...
}
and
class MyPage2: public MyPage1 {
Q_OBJECT
...
}
moc_MyPage2.cc 为空,链接时出现错误:
error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall dsw::MyPage2::metaObject(void)const" (?metaObject@MyPage2@dsw@@UBEPBUQMetaObject@@XZ)
有人可以指导我吗?
【问题讨论】:
-
我将文件 MyPage2 重命名为 MyPage21 并重新启动了 Visual Studio,清理并构建了项目并且它工作了!
-
是的!甚至我在 Visual Studio 上使用 Qt 时也遇到了链接问题
标签: c++ visual-studio qt qtcore moc