Qt 5.6.3 built with the WDK 7.1 toolchain — depends only on the system
msvcrt.dll, runs on Windows XP, no Visual C++ redistributable, and consumable
straight from CMake via find_package(Qt5) / FetchContent.
Qt 5.6.3 is the last Qt release that supports Windows XP. This repository builds
a trimmed qtbase (the desktop-widgets essentials, no OpenGL/DBus/SQL) plus
qtcharts and the lrelease / lupdate i18n tools with the Windows
Driver Kit 7.1 toolchain (cl 15.00, the VS2008 SP1 compiler), using a recipe
that links the dynamic system msvcrt.dll for the C runtime and statically
links the C++ standard library. The result:
- depends only on DLLs that ship with Windows (
msvcrt.dll,kernel32.dll, …) — nomsvcr90.dll/msvcp90.dll, no VC++ redistributable to install; - is built without Visual Studio — the WDK 7.1 toolchain is installed on a
stock GitHub-hosted runner by
tinysec/setup-wdk7; - is published as prebuilt CMake packages that downstream projects pull with FetchContent, or can be built from source with the same one switch.
- ✅ Zero redistributable — the only C runtime dependency is the system
msvcrt.dll; PE subsystem version5.00, so binaries load on Windows XP. - ✅ A minimal desktop-widgets toolkit + Charts —
Core,Gui,WidgetsandCharts, plusNetwork,Xml,Concurrent,Test,PrintSupport; theqwindowsplatform plugin; image formats (PNG/JPEG/GIF/BMP/... built intoQt5Gui, plus anICOplugin); and theqmake/moc/rcc/uictools. OpenGL, DBus and SQL are disabled, and the QML/Quick, Multimedia, WebEngine, SVG, … modules are not built — this is a trimmed UI library, not the full Qt. - ✅ i18n — runtime
QTranslator/QLocale/tr()is inCore; the package also shipslrelease/lupdateto compile (.ts→.qm) and extract (source→.ts) translations. - ✅ Static by default — links Qt into one self-contained
.exethat depends only onmsvcrt.dll; setQT5_SHARED=ONfor DLLs. Four prebuilt variants:i386/amd64×shared/static. - ✅ CMake-native — relocatable
Qt5Config.cmakefiles;find_package(Qt5),AUTOMOC/AUTORCC/AUTOUICall work. - ✅ Prebuilt or from source — one boolean (
QT5_FROM_SOURCE) switches between downloading a release asset and building locally. - ✅ Floating release — a
v5.6.3alias tag/release always points at the latest CI build with stable asset URLs. - ✅ No Visual Studio required, on the build side or the consumer side.
Each CI build publishes:
| Release | Marked | Asset names | Use for |
|---|---|---|---|
v5.6.3.<build> |
latest | qt-v5.6.3.<build>-wdk7-<link>-<arch>.zip |
reproducible pin |
v5.6.3 (alias) |
— | qt-wdk7-<link>-<arch>.zip (stable URL) |
track latest |
<link> is shared or static; <arch> is i386 or amd64. Stable URL form:
https://github.com/tinysec/wdk-qt5/releases/download/v5.6.3/qt-wdk7-<link>-<arch>.zip
Each .zip is an install prefix (bin/, lib/, include/, plugins/,
lib/cmake/).
Consuming Qt requires the setup-wdk7 toolchain (so your own code is built
with the same WDK 7.1 CRT recipe) plus this repo's cmake/qt5.cmake helper.
In your CI / build command:
cmake -S . -B build -G "NMake Makefiles" \
-DCMAKE_TOOLCHAIN_FILE=<setup-wdk7>/cmake/wdk7.cmake \
-DWDK7_ARCH=i386 # or amd64
cmake --build buildOn GitHub Actions, add the toolchain step:
- uses: tinysec/setup-wdk7@v1
id: wdk7
# then pass ${{ steps.wdk7.outputs.toolchain-file }} as CMAKE_TOOLCHAIN_FILEVendor cmake/qt5.cmake (or file(DOWNLOAD …) it), then:
include(qt5.cmake)
# Default is STATIC: one self-contained .exe depending only on msvcrt.dll, which
# is the point of this XP/zero-redist build. Set QT5_SHARED=ON for DLLs.
qt5_provide() # QT5_ARCH follows WDK7_ARCH; sets CMAKE_PREFIX_PATH
find_package(Qt5 5.6 REQUIRED COMPONENTS Core Widgets)
set(CMAKE_AUTOMOC ON)
add_executable(app WIN32 main.cpp)
target_link_libraries(app Qt5::Core Qt5::Widgets)
qt5_deploy(app) # copies Qt DLLs next to the exe (no-op when static)
# A static Qt build needs the platform plugin imported explicitly:
if(NOT QT5_SHARED)
target_link_libraries(app Qt5::QWindowsIntegrationPlugin)
# and Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) in your source
endif()Static (the default) links Qt into the executable: a single app.exe that
depends only on the system msvcrt.dll — nothing to deploy. With QT5_SHARED=ON
you get Qt DLLs; qt5_deploy(app) then copies them (and the platform plugin)
next to the .exe so it runs without putting the Qt bin/ on PATH.
| Option | Type | Default | Meaning |
|---|---|---|---|
QT5_SHARED |
BOOL | OFF |
OFF = static self-contained .exe, ON = shared DLLs |
QT5_FROM_SOURCE |
BOOL | OFF |
OFF = download prebuilt, ON = build from source |
QT5_ARCH |
STRING | follows WDK7_ARCH |
i386 or amd64 |
Runtime translation is built in (QTranslator, QLocale, tr()). To author
your own translations, the package ships lrelease / lupdate in bin/:
lupdate main.cpp -ts app_zh_CN.ts # extract tr() strings into a .ts
# ... translate app_zh_CN.ts ...
lrelease app_zh_CN.ts # compile the .ts into app_zh_CN.qmPNG, BMP, JPEG, GIF, PBM/PGM/PPM, XBM/XPM are built into
Qt5Gui and work with no extra setup — in the static build they are linked
right into your .exe. ICO is the one format that stays a separate plugin; a
static app that loads .ico must import it:
#include <QtPlugin>
Q_IMPORT_PLUGIN(QICOPlugin) // static only; link Qt5::QICOPlugin tooFor a shared build, JPEG/GIF/ICO are DLL plugins under
plugins/imageformats/; qt5_deploy() copies them next to the executable.
The build is driven by plain scripts under hack/wdk-qt/ (each respects
QT_ARCH = i386/amd64 and QT_LINK = shared/static):
set QT_ARCH=i386
set QT_LINK=static
hack\wdk-qt\clean-build.bat :: configure + build qtbase into build-wdk-qtbase-i386-static
hack\wdk-qt\install.bat :: nmake install (+ patch static CMake deps, drop QtSql)
hack\wdk-qt\build-qtcharts.bat :: build Qt5Charts into the same prefix
hack\wdk-qt\build-i18n.bat :: build lrelease/lupdate into the prefix bin/The WDK is located via W7BASE / WDK7_ROOT (set by setup-wdk7), falling back
to C:\WinDDK\7600.16385.1.
- A custom mkspec
win32-wdk7-msvc2008plus a force-includedwdk-compat.hsupply the CRT shims the WDK omits (the systemmsvcrt.dllis VC6-era), and linkntstc_msvcrt.libfor the statically-linked C++ standard library. - Self-contained shim headers replace SDK/compiler headers the WDK lacks
(
intrin.h,windns.h,commoncontrols.h, …). - A handful of small, guarded
qtbasesource patches handle gaps in the old STL70 headers and the 32-bit-time_tCRT. configuredisables OpenGL, DBus and SQL (-no-opengl -no-dbus -no-sql-sqlite); the QtSql lib body, which Qt 5.6 always builds, is deleted after install.NetworkandXmlare kept (useful for GUI apps; note no HTTPS, since-no-openssl).qtchartsis vendored and built with the same mkspec/shims (onlysyncqtis needed for its forwarding headers). For the static build, the plugin import targets are patched so a GUI app links the platform plugin cleanly.- The i18n tools come from the vendored
qttools/src/linguist;lupdategets anasInvokermanifest force-embedded so Windows installer-detection does not flag itsupdatename and demand elevation.
Qt 5.6.3 is licensed under LGPLv2.1 / LGPLv3 (and GPL); see the LICENSE.*
files. The build tooling in this repository is provided under the same terms.