|
我在 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’这样的错误???请问如何解决??? |
|