Linux Live+(316606233) 13:39:29
Win QT4 "Hello World!" 为什么总是编译不通过?
源码===========
#include <QtGui/QtGui>
int main(int argc, char *argv[]){
QApplication app(argc, argv);
QPushButton hello("Hello world!", 0);
hello.resize(100, 30);
app.setMainWidget(&hello);
hello.show();
return app.exec();
}
编译中==============
E:\QT-MAKE>mingw32-make
mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `E:/QT-MAKE
g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNIC
LL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_GUI_LIB -DQ
-I"D:/Qt/4.0.0/include/QtGui" -I"D:/Qt/4.0.0/i
lude" -I"." -I"D:/Qt/4.0.0/include/ActiveQt" -I
specs\win32-g++" -o release\main.o main.cpp
main.cpp: In function `int qMain(int, char**)':
main.cpp:10: error: 'class QApplication' has no
mingw32-make[1]: *** [release\main.o] Error 1
mingw32-make[1]: Leaving directory `E:/QT-MAKE'
mingw32-make: *** [release] Error 2
Linux Live+(316606233) 13:40:04
有没有人解释下。。。
XChinux(23947407) 13:49:24
这是QT几?
Linux Live+(316606233) 13:40:26
4
XChinux(23947407) 13:50:15
app.setMainWidget(&hello); //这句话不需要了
hello.show();
return app.exec()
Linux Live+(316606233) 13:42:52
谢谢。。。 解决了