Qt 6.8.1 Dynamic Compilation Guide for Windows 7
Last Modified: 15-01-2025
This guide focuses on a full Qt 6.8.1 dynamic compilation with MSVC on Windows 7 with all optional modules. We require to use Qt 6.5.0 WebEngine as it is the last version with Chromium pre-110 support required for Windows 7.
Time to compile: around 5 hours on Intel Core i7-4770 @ 3.40GHz (4C/8T).
Required Software
Qt6
- MSVC build tools 2019 or higher.
- CMake 3.21 or higher.
- Ninja 1.7.2 or higher.
- Python >3.7 and <3.10. 3.8 is highly recommended.
If you have other Python installations higher than 3.9, move them to a seperate directory temporarily and hide it.
- Git.
- LLVM 17 or higher with RTTI support. Recommended Version for MSVC 2019.
- OpenSSL 3.0.15 or higher. Required to link statically to OpenSSL libs; no longer require
libcrypto-3-x64.dllandlibssl-3-x64.dllfor QtWebChannel.
Qt6 WebEngine
- Windows 11 SDK 10.0.22621.0 or higher.
- Node.js 12 or higher.
- Python html5lib.
python -m pip install html5lib
- Bison, Flex, and GPerf. You can compile them from source or use just about any precompiled executable you find online.
Required Files
- Qt 6.8.1 sources.
- Qt 6.5.0 WebEngine sources.
- Qt 6.8.1 qtbase Windows 7 patch.
- Qt 6.5.0 WebEngine patch for Qt 6.8.1. Required for the 6.5.0 to compile successfully with 6.8.1 base.
- Hunspell Keyboard Language Files. Required for spelling correction with QtVirtualKeyboard.
Steps
- Create directory structure. For the purposes of this guide, we choose a Qt home directory of
C:\Qt. -
Extract sources
- Qt 6.8.1 sources to
C:\Qt\6.8.1\src. - Qt 6.5.0 WebEngine source to
C:\Qt\6.5.0\src\qtwebengine.
- Qt 6.8.1 sources to
-
Apply patches
- For Qt 6.8.1, simply override all files in
C:\Qt\6.8.1\srcwith the ones included in the Windows 7 GitHub repoistory. - Delete the
qtwebenginedirectory inC:\Qt\6.8.1\src. We will be configuring and building Qt 6.5.0 one later. - For Qt 6.5.0, place the patch in
C:\Qt\6.5.0\src\qtwebengineand execute the following command in Git Bash in the same directory:
- For Qt 6.8.1, simply override all files in
-
Configure Qt 6.8.1 building prerequisites
- Extract LLVM recommended version to
C:\Qt\Tools\LLVM. - Set up
hunspellfor QtVirtualKeyboard as follows:- Clone the hunspell repistory in
C:\Qt\6.8.1\src\qtvirtualkeyboard\src\plugins\hunspell\3rdparty\hunspell
- Extract keyboard language files in
C:\Qt\6.8.1\src\qtvirtualkeyboard\src\plugins\hunspell\3rdparty\hunspelland verify they are located underdatadirectory.
- Clone the hunspell repistory in
- Extract LLVM recommended version to
-
Build Qt 6.8.1 sources
- Create build directory
C:\Qt\6.8.1\build. - Select installation directory
C:\Qt\6.8.1\msvc2019_64. - Verify OpenSSL directory
C:\Program Files\OpenSSL. - Open
x64 Native Tools Command Prompt for VS 2019and execute the following commands line-by-line:
- Wait for configuration to complete. No errors or warnings should be reported.
- Build all of Qt 6.8.1 with the following command. This should take around an hour or two.
- Once building is complete, install Qt 6.8.1 to the chosen installation directory using the following command.
- To verify successful building, open
designer.exeinC:\Qt\6.8.1\msvc2019_64\bin. The Qt Widgets Designer should open fine.
- Create build directory
-
Build Qt 6.5.0 WebEngine sources
- Create build directory
C:\Qt\6.5.0\build\qtwebengine. - Verify installation directory
C:\Qt\6.8.1\msvc2019_64. - Open
x64 Native Tools Command Prompt for VS 2019and execute the following commands line-by-line:
- Wait for configuration to complete. No errors or warnings should be reported.
- Build Qt 6.5.0 with the following command. This should take around three to four hours.
- Once building is complete, install Qt 6.5.0 WebEngine to the chosen installation directory using the following command.
- To verify successful building, find
Qt6WebEngineCore.dllin the installation directoryC:\Qt\6.8.1\msvc2019_64\bin.
- Create build directory