学习C++ GUI Programming with Qt 4遇到的问题(1)
2014-03-02 17:27
627 查看
1.编译提示下面错误
说明:FindDialog是我写的QDialog的子类,findPrevious是FindDialog的signal
finddialog.cpp:(.text+0x567): undefined reference to `FindDialog::findPrevious(QString const&, Qt::CaseSensitivity)'
finddialog.cpp:(.text+0x591): undefined reference to `FindDialog::findNext(QString const&, Qt::CaseSensitivity)'
原因:在FindDialog的definition中没有Q_OBJECT
解决办法加入Q_OBJECT即可解决
2.编译提示下面错误
finddialog.o: In function `FindDialog::FindDialog(QWidget*)':
finddialog.cpp:(.text+0x27): undefined reference to `vtable for FindDialog'
finddialog.cpp:(.text+0x2f): undefined reference to `vtable for FindDialog'
finddialog.cpp:(.text+0x3b): undefined reference to `FindDialog::staticMetaObject'
finddialog.cpp:(.text+0xb5): undefined reference to `FindDialog::staticMetaObject'
finddialog.cpp:(.text+0xfe): undefined reference to `FindDialog::staticMetaObject'
finddialog.cpp:(.text+0x147): undefined reference to `FindDialog::staticMetaObject'
finddialog.cpp:(.text+0x190): undefined reference to `FindDialog::staticMetaObject'
finddialog.o:finddialog.cpp:(.text+0x36f): more undefined references to `FindDialog::staticMetaObject' follow
finddialog.o: In function `FindDialog::findClicked()':
finddialog.cpp:(.text+0x567): undefined reference to `FindDialog::findPrevious(QString const&, Qt::CaseSensitivity)'
finddialog.cpp:(.text+0x591): undefined reference to `FindDialog::findNext(QString const&, Qt::CaseSensitivity)'
原因:工程文件没有更新
解决办法:重新进行编译
qmake -project
qmake 工程名.pro
make
说明:FindDialog是我写的QDialog的子类,findPrevious是FindDialog的signal
finddialog.cpp:(.text+0x567): undefined reference to `FindDialog::findPrevious(QString const&, Qt::CaseSensitivity)'
finddialog.cpp:(.text+0x591): undefined reference to `FindDialog::findNext(QString const&, Qt::CaseSensitivity)'
原因:在FindDialog的definition中没有Q_OBJECT
解决办法加入Q_OBJECT即可解决
2.编译提示下面错误
finddialog.o: In function `FindDialog::FindDialog(QWidget*)':
finddialog.cpp:(.text+0x27): undefined reference to `vtable for FindDialog'
finddialog.cpp:(.text+0x2f): undefined reference to `vtable for FindDialog'
finddialog.cpp:(.text+0x3b): undefined reference to `FindDialog::staticMetaObject'
finddialog.cpp:(.text+0xb5): undefined reference to `FindDialog::staticMetaObject'
finddialog.cpp:(.text+0xfe): undefined reference to `FindDialog::staticMetaObject'
finddialog.cpp:(.text+0x147): undefined reference to `FindDialog::staticMetaObject'
finddialog.cpp:(.text+0x190): undefined reference to `FindDialog::staticMetaObject'
finddialog.o:finddialog.cpp:(.text+0x36f): more undefined references to `FindDialog::staticMetaObject' follow
finddialog.o: In function `FindDialog::findClicked()':
finddialog.cpp:(.text+0x567): undefined reference to `FindDialog::findPrevious(QString const&, Qt::CaseSensitivity)'
finddialog.cpp:(.text+0x591): undefined reference to `FindDialog::findNext(QString const&, Qt::CaseSensitivity)'
原因:工程文件没有更新
解决办法:重新进行编译
qmake -project
qmake 工程名.pro
make
相关文章推荐
- Qt学习书籍:C++ GUI Programming with Qt 4
- C++ GUI Programming with Qt 4 - 10.4 实现自定义代理(delegate)
- C++ GUI Programming with Qt 4 - 10.3 实现自定义模型
- C++ GUI Programming with Qt 4 中的信号与槽
- 翻译Qt4教程:C++ GUI Programming with Qt 4
- C++ GUI Programming with Qt 3安装说明
- 《C++ GUI Programming with Qt 4, Second Edition》读书笔记1
- C++ GUI Programming with Qt 4 - 10.3 实现自定义模型
- 从第二章开始规范翻译C++ GUI Programming with Qt 4
- C++ GUI Programming with Qt 4 - 10.4 实现自定义代理(delegate)
- C++ Gui Programming With Qt 4 一到十章汉化的是哪个版本??
- C++ GUI Programming with Qt 4
- 《C++ GUI Programming with Qt 4, Second Edition》读书笔记2
- 4)(转C++ GUI Programming with Qt 4)~Qt~深入信号槽
- C++ GUI Programming with Qt3(系列一 试翻)
- C++ GUI Programming with Qt 4
- C++ GUI Programming with Qt 4 - 10.3 实现自定义模型
- [C++ GUI Programming with Qt 4/5 代码] && [从Qt4过渡至Qt5(The Transition from Qt 4.x to Qt 5)]
- Qt的学习资料比起其它C/C++的GUI组件来说已经算很全的了
- 本人小白一枚,刚学习SpringMVC+MyBatis,遇到了一个问题一直报错 **No mapping found for HTTP request with URI**