Qt 5.7.0 为最后一版支持winXP的Qt
需要使用msvc2015进行编译 不支持msvc2017
编译时使用vs2017附带的msvc2015编译器似乎有问题,所以使用vs2015进行编译
但之后可以使用vs2017生成程序
1.安装python2.7 perl
2.解压源码包 修改几处文件
修改qtbase\qmake\Makefile.win32
在CFLAGS_BARE后加入-D_USING_V110_SDK71_
修改qtbase\mkspecs\common\msvc-desktop.conf
在DEFINES中加入_USING_V110_SDK71_
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE,5.01
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS,5.01
QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_OPTIMIZE -MT
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -MT -Zi
QMAKE_CFLAGS_DEBUG = -Zi -MTd
3.依次执行
CALL “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat” x86
SET PATH=C:\Python27;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
SET INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE%
SET LIB=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;%LIB%
SET CL=/D_USING_V110_SDK71_
SET _ROOT=<源码目录>
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
SET QMAKESPEC=win32-msvc2015
SET _ROOT=
4.生成配置文件
configure.bat -mp -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -static-target xp -prefix <生成目录> -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 -no-directwrite
5.编译
nmake
nmake install
自编译版本 下载链接 https://pan.baidu.com/s/1kAekPuJpUSvUOp9iVb3Mqw