首页| 论坛| 消息

标题:【提问】Win QT4 "Hello World!" 为什么总是编译不通过?
作者:XChinux
日期:2005-08-04 13:56
内容:

Linux Live+(316606233) 13:39:29
Win QT4 "Hello World!" 为什么总是编译不通过?
源码===========
#include
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]: *** Error 1
mingw32-make[1]: Leaving directory `E:/QT-MAKE'
mingw32-make: *** 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
谢谢。。。 解决了


#1 [血魔 08-28 20:41]
楼主 这个是因为qt4和qt3的不同引起的把...
请问以前用qt3编的程序能用qt4兼容的么???
#2 [XChinux 08-28 21:29]
有专门的Qt3到Qt4的移植工具。
#3 [血魔 08-29 10:45]
zhidao la
#4 [lovelaoliu 03-08 01:52]
好牛哦
#5 [sunxiaoming 03-08 05:31]
能介绍下qt3到qt4移植的工具马,谢谢了

回复 发表
主题 版块