Building Qt-4.8.6 x32 on Windows with VS2013 so that it works on WinXP+

You will need VS2013 (express works fine) and the Windows SDK v7.1A. You also need perl, I use ActivePerl 64 bits and my qt-4.8.6-win.patch (can be found here https://github.com/sandym/qt-patches). We’ll do a shadow build, for this I have Qt 4.8.6 sources in C:\Qt\qt-4.8.6, I’ll build in C:\Qt\qt-4.8.6-build and install C:\Qt\qt-4.8.6-x32.

First patch the source code, I do that from a cygwin shell:

> cd /cygdrive/c/Qt/qt-4.8.6
> patch -p1 --binary < ../qt-4.8.6-win.patch

Start the VS2013 x86 Native Tools Command Prompt.
Remove cygwin from PATH.

> set PATH=%PATH:C:\cygwin\bin;=%

Set SDK for WinXP.

> set INCLUDE=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE%
> set LIB=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Lib;%LIB%
> set PATH=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
> set CL=/D_USING_V110_SDK71_

We need perl for shadow build:

> set PATH=C:\Qt\Perl64\bin;%PATH%

Configure, note that this is the configuration I use and know to work, you might have some luck with something different, but some do fail. You’re on your own if you do it differently.
> cd C:\Qt\qt-4.8.6-build
> ..\qt-4.8.6\configure.exe -prefix C:\Qt\qt-4.8.6-x32 —debug-and-release -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-libtiff -no-libmng -no-dbus -no-nis -webkit -platform win32-msvc2013

Build and install:
> jom.exe
> jom.exe install

Done!

Leave a comment