vs2017安裝在"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"。
qt源碼在"F:\qt-everywhere-opensource-src-5.9.1"
1. 打開cmd,執行vs編譯工具鏈的環境設置
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
2. 執行qt的configure配置。這裏,不要編譯qtwebengine,因爲qtwebengine的代碼有問題,會編譯錯誤cd F:\qt-everywhere-opensource-src-5.9.1
mkdir qt-build && cd qt-build
..\configure.bat -skip qtwebengine -confirm-license -opensource -debug-and-release -nomake tests -nomake examples -prefix F:\Qt\5.9.1_x64
3. 執行make。建議將make的輸出重定向,因爲cmd窗口保留的記錄太短了
nmake > nmake.out.txt 2>&1
4.
nmake install
5. 另外還可以安裝qt文檔
nmake docs
nmake install_docs