c++ GUI Qt4 的关于forward declaration of "class xxx 的错误"

来源:互联网 发布:中医 数据库 编辑:程序博客网 时间:2024/06/06 01:08
C++ GUI Qt4 23页的程序在编译时出了个错误ubunto终端显示错误如下main.cpp:18:43: error: invalid use of incomplete type ‘class QPushButton’ buttonBox->button(QDialogButtonBox::Ok)->setEnabled(lineEdit->hasAcceptableI ^In file included from /usr/local/Trolltech/Qt-4.8.1/include/QtGui/QDialog:1:0, from main.cpp:2:/usr/local/Trolltech/Qt-4.8.1/include/QtGui/qdialog.h:53:7: note: forward declaration of ‘class QPushButton’ class QPushButton; ^Makefile:213: recipe for target 'main.o' failedmake: *** [main.o] Error 1包含一个头文件#include就可以了!哈哈
阅读全文
0 0
原创粉丝点击