2, 取得Win32下的補(bǔ)丁download
3, 將兩個(gè)文件解壓到相同目錄,如D:\Qt4
4, 打開VS2003命令行窗口,這自動(dòng)對(duì)環(huán)境變量進(jìn)行了設(shè)置。
5,從命令行窗口進(jìn)入D:Qt4, 執(zhí)行installpatch42.bat ,這是從補(bǔ)丁解壓得到的文件之一。
6, 執(zhí)行 qconfigure.bat msvc.net
7,提示協(xié)議信息, 等待響應(yīng),鍵入'Y'
8,又提示,鍵入'y'
9可能又一個(gè)提示,鍵入'y'
10,出現(xiàn)類似以下提示:
==================================================== You are now ready to build Qt If you specified -static, type 'nmake sub-src' otherwise, type 'nmake' To start over, type 'nmake distclean' and then re-run qconfigure.bat ====================================================
11, 執(zhí)行 nmake
12,編譯結(jié)束后,設(shè)置機(jī)器的環(huán)境變量 path : 添加路徑 D:\Qt4\bin , 創(chuàng)建新的變量,QMAKESPEC,值為win32-msvc.net
13,新建一個(gè)文件hello.cpp,內(nèi)容如下(開始測(cè)試是否安裝好了)
#include <QApplication>
#include <QLabel>
int main(int argc, char **argv) {
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello World!");
label->show();
return app.exec();
}
14,在VS2003命令窗口下,進(jìn)入cpp文件所在目錄,如D:\test
15,qmake -project -t vcapp -o projectname.pro
16,再來(lái)一次,不帶參數(shù) qmake
17,當(dāng)前目錄下生成了VS工程文件:projectname.vcproj
18,用VS2003將 此工程打開,編譯,運(yùn)行。