c++ GUI Qt4 的关于forward declaration of "class xxx 的错误"
- 作者: 青山青水
- 来源: 51数据库
- 2021-08-05
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就可以了!哈哈
推荐阅读
