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