Skip to content

How to build Qt Static compatible XP with VS2013 and Win 10

Iceyer edited this page Feb 2, 2016 · 2 revisions

Deepin Boot Maker should work on almost all Windows platform( form Windows XP to Windows Ten, both 32bit and 64 bit), and the is two base requirement:

  • 1 Use a single executable file that it can be easily used, So you should build an static Qt.

  • 2 Windows XP DO NOT full support OpenGL2 and Direct X 11, so use Angel with Direct X 9 installed.

You can use VS2010 and Direct X SDK to build Qt, but it can not support C++ 11, so we pass it.

It you want build Qt 5.5 with VS2013, do by this steps:

1 Change Qt config:

For Qt 5.5, open Z:\qt-everywhere-opensource-src-5.5.1\qtbase\mkspecs\common\msvc-desktop.conf

Support static link, change

QMAKE_CFLAGS_RELEASE    = -O2 -MD
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
QMAKE_CFLAGS_DEBUG      = -Zi -MDd

to

QMAKE_CFLAGS_RELEASE    = -O2 -MT
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
QMAKE_CFLAGS_DEBUG      = -Zi -MTd

Support Windows XP platform, and -target xp when you run configure

2 buld Qt with this:

IF YOU USE VS2013 and Windows Kit, DONOT SET DIRECTX_SDK

%comspec% /k ""D:\Dev\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86
configure -prefix "D:\Qt\QtStatic\5.3\vs2013" -debug-and-release -platform win32-msvc2013 -confirm-license -opensource -static -qt-pcre -no-icu -no-sql-sqlite -no-nis -no-cups -no-iconv -no-dbus -nomake examples -no-sql-odbc -no-compile-examples -skip qtwebkit -skip qtwebkit-examples -skip qtactiveqt -no-openssl -qt-zlib -qt-libpng -qt-freetype -qt-libjpeg -opengl es2 -angle -target xp

if you want run you application on winxp, you must add -target xp, also -opengl es2 -angle is necessary.

also you can use jom to speed up.