1、安装QT4.8.0SDK(QTCreator2.4)
2、安装MinGw(Qt4.8.0SDK)
3、在QtCreator\工具\选项\构建和运行\Qt版本\添加,选择qmake路径,如d:\qt\4.8.0\bin\qmake.exe
4、添加qmake所在目录到环境变量,如D:\Qt\4.8.0\bin\
5、添加mingw32-make目录到环境变量,如D:\Qt\qtcreator-2.4.1\mingw\bin\
6、MSWindows下编译命令
qmake -o Makefile xxx.pro
mingw32-make
a、程序文件:main.cpp,hello.pro,hello.h,hello.cpp
b、创建makefile文件:qmake -o Makefile hello.pro
生成Makefile、Makefile.Debug、Makefile.Release文件及debug、release空文件夹
c、执行makefile文件,编译程序:mingw32-make
debug文件夹下生成hello.exe文件及
d、执行hello.exe文件,运行程序
命令组合2 qmake -project 生成.pro文件,再用qmake生成Makefile文件,make(会自动执行mingw32-make)生成可执行程序
把ui文件转换层.h文件,(xml->cpp):uic -o mainwindow.h mainwindow.ui