标签:
近期由于另外一个项目需要用 vs2015 ,于是把 Qt 也升级到了 5.6.0 。由于项目需要兼容 Windows xp ,所以需要自己编译 Qt 。这里大致整理一下编译的过程。
1 REM ********** Initialize env for msvc 2015 cl compiler ********** 2 SET PATH=C:\Windows;C:\Windows\system32 3 REM Set up \Microsoft Visual Studio 2015, where <arch> is amd64, x86, etc. 4 CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 5 6 REM ********** Update include & lib to support xp win sdk 7.1A ********** 7 SET PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH% 8 SET INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE% 9 SET LIB=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;%LIB% 10 SET CL=/D_USING_V140_SDK71_;%CL% 11 12 REM ********** 3rd party build tools binaries: ruby, perl, python ********** 13 SET PATH=C:\Ruby22-x64\bin;C:\Perl64\bin;C:\Python35;%PATH% 14 15 REM ********** Set up qt source env ********** 16 SET _ROOT=E:\qt-everywhere-opensource-src-5.6.0 17 SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH% 18 REM Uncomment the below line when using a git checkout of the source repository 19 REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH% 20 SET QMAKESPEC=win32-msvc2015 21 SET _ROOT= 22 23 REM Generate makefile 24 configure.bat -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -static -target xp -prefix D:\Qt\Qt5.6.0-static-win32-vs2015-xp -qt-sql-sqlite -qt-sql-odbc -plugin-sql-sqlite -plugin-sql-odbc -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -qt-freetype -no-qml-debug -no-angle -nomake tests -nomake examples -skip qtquickcontrols -skip qtquickcontrols2 -skip qtsensors -skip qtdoc
E:
cd E:\qt-everywhere-opensource-src-5.6.0
qt-build.bat
nmake
下面对 qt-build.bat 文件做一个简要的说明。
最后,附上 Qt5 官方关于 Windows 支持的资料的链接:http://doc.qt.io/qt-5/windows-support.html 。
标签:
原文地址:http://www.cnblogs.com/bbxx111/p/5461069.html