搭建Qt for windows 开发环境
2008年11月17日 星期一 11:56
准备:
1、Dev C++,(Version: 4.9.9.2)
2、qt-win-opensource-4.4.3-mingw.exe,(dowload:
http://trolltech.com/downloads-cn)
安装:
1、安装DevC++
2、安装qt-win-opensource-4.4.3-mingw.exe,安装过程中,需要指定mingw目录,直接选择DevC++安装的目录即可。
测试:
1、设置windows环境变量path,增加如下内容:
D:\Qt\4.4.3\bin;D:\Program Files\DEV-CPP\Bin;
(Note:我的QT和DevC++安装在D盘)
2、建一目录:hello,在目录中建一文本文件helloworld.cpp,内容如下:
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
3、进入命令提示符,进入hello目录,输入:
qmake -project helloworld.cpp
将产生:hello.pro 文件
4、输入:
qmake
将产生:
makefile
makefile.debug
makefile.release
以及release和debug目录
5、输入:
make
将产生debug/hello.exe 文件
6、执行hello.exe
转贴自:
http://hi.baidu.com/%D7%D3%B7%E1/blog/item/829e420847dc23d663d98671.html