• 8491阅读
  • 1回复

菜鸟求助!......has initializer but incomplete type [复制链接]

上一主题 下一主题
离线klarm
 

只看楼主 倒序阅读 楼主  发表于: 2010-03-19
看了一个范例的代码。在我的机子里试了一下,但是出现了......has initializer but incomplete type的错误,还望大家给个解答,谢谢。代码如下
#include <QtCore/QCoreApplication>
#include <qpushbutton.h>

int main(int argc, char *argv[])
{
QApplication a(argc,argv);

QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );

a.setMainWidget( &hello );
hello.show();
return a.exec();


}

错误信息: error: variable `QApplication a' has initializer but incomplete type
离线carl_xwz
只看该作者 1楼 发表于: 2010-03-21
很明显你的头文件包含错误了!
#include<QApplication>就可以
QApplication继承了QCoreApplication.
快速回复
限100 字节
 
上一个 下一个