LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 578|回复: 0

首次运行Qt出问题!!!!!!

[复制链接]
发表于 2007-3-29 14:53:08 | 显示全部楼层 |阅读模式
我在 suse 下运行Qt官方的tutorial1-01:

#include <qapplication.h>
#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();
}


qmake -projedt 和 qmake都没问题 可是在make时有了错误:

g++ -c -pipe -O2 -Wall -W -D_REENTRANT  -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtGui -I/usr/include -I. -I. -I. -o 1.o 1.cpp
1.cpp: In function ‘int main(int, char**)’:
1.cpp:12: error: ‘class QApplication’ has no member named‘setMainWidget’
make: *** [1.o] Error 1

我的系统是suse10.2  Qt就是安装系统时默认的 好像还安了两个版本(3.3.7和4.2.1)怎么会有‘class QApplication’ has no member named‘setMainWidget’这样的错误???请问如何解决???
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表