This guide provides comprehensive instructions for building QtWebEngine and QtPdf for Windows ARM64 architecture. As of the current Qt releases, official ARM64 binaries for QtWebEngine are not available, making this build process necessary for ARM64 development.
- Windows 10/11 x64 system for cross-compilation
- Visual Studio 2022 with MSVC toolchain
- At least 16GB RAM (32GB recommended)
- 50GB+ free disk space
- Git for version control
Ensure you have the following Visual Studio 2022 components installed:
- MSVC v143 - VS 2022 C++ x64/x86 build tools
- MSVC v143 - VS 2022 C++ ARM64 build tools
- Windows 11 SDK (latest version)
- CMake tools for Visual Studio
- Git for Windows
- MSVC v143 - VS 2022 C++ ATL for latest v143 build tools (x86 & x64)
- MSVC v143 - VS 2022 C++ ATL for latest v143 build tools (ARM64)
First, install the Python package manager and aqt:
pip install aqtinstall
Install Qt 6 for Windows x64 (host compiler):
aqt install-qt --outputdir C:\Qt windows desktop 6.9.0 win64_msvc2022_64
Install Qt 6 for Windows ARM64 (target compiler):
aqt install-qt --outputdir C:\Qt windows desktop 6.9.0 win64_msvc2022_arm64
- Download the Qt Online Installer from qt.io
- Install Qt 6.9.0 with the following components:
- MSVC 2022 64-bit (host)
- MSVC 2022 ARM64 (target)
Open x64 Native Tools Command Prompt for VS 2022 and execute:
# Navigate to your desired build location
cd C:\
# Clone the QtWebEngine repository
git clone https://code.qt.io/qt/qtwebengine.git
cd qtwebengine
# Checkout the desired version (match your Qt version)
git checkout 6.9.0
# Initialize and update all submodules (this will take time)
git submodule update --init --recursive
# Return to the root directory
cd ..
Before building, you need to apply a critical patch to fix compilation issues with the V8 engine on ARM64.
Apply a patch file to fix the marking state issue:
# Navigate to the qtwebengine chromium directory
cd C:\qtwebengine\src\3rdparty\chromium
# Create the patch file
curl -LO https://raw.githubusercontent.com/fauzanelka/qtwebengine-arm64/refs/heads/main/v8-marking-state.patch
# Apply the patch
git apply v8-marking-state.patch
If the patch command fails, you can manually edit the file:
- Open
C:\qtwebengine\chromium\v8\src\heap\cppgc\marking-state.h
in a text editor - Find line ~361 that contains:
return MutatorMarkingState::BasicMarkingState::MarkNoPush(header);
- Replace it with:
return BasicMarkingState::MarkNoPush(header);
- Save the file
Important: This patch fixes a C++ compilation error where the qualified name lookup fails on ARM64 builds. Without this patch, the build will fail with compilation errors.
GN must be built first as a native x64 binary before cross-compiling QtWebEngine.
# Create build directory
mkdir build-qtwebengine-arm64
cd build-qtwebengine-arm64
# Configure to build only GN initially
C:\Qt\6.9.0\msvc2022_64\bin\qt-configure-module.bat ..\qtwebengine -- -DBUILD_ONLY_GN=ON
# Build GN (may fail on first attempt - this is normal)
cmake --build . --parallel
# Build again (should succeed on second attempt)
cmake --build . --parallel
Note: The GN build often fails on the first attempt due to dependency resolution. Running the build command twice typically resolves this issue.
You need to switch to the ARM64 cross-compilation environment. Do one of the following:
Option A: Run the batch file directly:
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
Option B: Open "x64_arm64 Cross Tools Command Prompt for VS 2022" from the Start Menu
Navigate back to your build directory and configure for ARM64:
cd C:\build-qtwebengine-arm64
# Clear CMakeCache.txt
rm CMakeCache.txt
# Configure for ARM64 cross-compilation
C:\Qt\6.9.0\msvc2022_arm64\bin\qt-configure-module.bat ..\qtwebengine -- -DQT_HOST_PATH=C:\Qt\6.9.0\msvc2022_64 -DFEATURE_webengine_build=OFF
Choose one of the following based on your needs:
To build only QtPdf (faster, recommended for most users):
C:\Qt\6.9.0\msvc2022_arm64\bin\qt-configure-module.bat ..\qtwebengine -- -DQT_HOST_PATH=C:\Qt\6.9.0\msvc2022_64 -DFEATURE_webengine_build=OFF
To build both QtPdf and QtWebEngine (slower, complete build):
C:\Qt\6.9.0\msvc2022_arm64\bin\qt-configure-module.bat ..\qtwebengine -- -DQT_HOST_PATH=C:\Qt\6.9.0\msvc2022_64 -DFEATURE_webengine_build=ON
# Begin the build (this will take several hours)
cmake --build . --parallel
After the build is complete, you need to install the libraries. It's recommended to install to a separate directory to avoid conflicts with your native Qt installation.
# Install to a separate ARM64-specific directory
cmake --install . --prefix C:\Qt-arm64
# Alternative: Install to a versioned directory
cmake --install . --prefix C:\Qt\6.9.0-arm64
After installation, you can create a ZIP archive for easy distribution:
# Navigate to the installation directory
cd C:\Qt-arm64
# Create a ZIP archive (requires 7-zip or similar)
# Using PowerShell:
Compress-Archive -Path ".\*" -DestinationPath "C:\QtWebEngine-6.9.0-ARM64.zip"
# Or using 7-zip (if installed):
7z a "C:\QtWebEngine-6.9.0-ARM64.zip" "C:\Qt-arm64\*"
- QtPdf only: 30-60 minutes (depending on hardware)
- QtPdf + QtWebEngine: 2-6 hours (depending on hardware)
-
GN Build Fails
- Solution: Run the build command twice as shown in Step 3
-
Out of Memory Errors
- Reduce parallel jobs:
cmake --build . --parallel 4
- Ensure you have adequate RAM and virtual memory
- Reduce parallel jobs:
-
Missing Dependencies
- Verify all Visual Studio components are installed
- Check that both x64 and ARM64 MSVC toolchains are available
-
Git Submodule Issues
- Run:
git submodule update --init --recursive --force
- Run:
-
V8 Compilation Errors
- Ensure the V8 patch from Step 3 has been applied correctly
- Check that the file
chromium/v8/src/heap/cppgc/marking-state.h
contains the corrected line - If you see errors related to
MutatorMarkingState::BasicMarkingState
, the patch wasn't applied
After a successful build and installation, you should find the ARM64 libraries in:
C:\Qt-arm64\lib\
(if using custom installation directory)C:\Qt\6.9.0\msvc2022_arm64\lib\
(if installed to existing Qt directory)- Or in your build directory under appropriate subdirectories (before installation)
Key files to look for:
Qt6WebEngine.dll
andQt6WebEngine.lib
(if building full QtWebEngine)Qt6Pdf.dll
andQt6Pdf.lib
(QtPdf libraries)Qt6WebEngineCore.dll
(core WebEngine components)
Once built and installed, you can use QtWebEngine/QtPdf in your ARM64 applications by:
- Setting your Qt installation path: Point your development environment to the ARM64 installation directory (e.g.,
C:\Qt-arm64
) - Configuring your project: Set your project to target ARM64 architecture
- Linking against the libraries: Link against the newly built QtWebEngine/QtPdf libraries
- Deploying: Include the ARM64 DLLs with your application distribution
If you installed to C:\Qt-arm64
, you can:
- Set
CMAKE_PREFIX_PATH
toC:\Qt-arm64
in your CMake projects - Or set
QTDIR
environment variable toC:\Qt-arm64
- Add
C:\Qt-arm64\bin
to your PATH for runtime DLL discovery
- This process requires significant disk space and time
- Building on a machine with SSD storage will significantly improve build times
- Consider using a dedicated build machine or VM with ample resources
- Keep your Qt version, Visual Studio, and Windows SDK up to date for best compatibility
If you encounter issues or have improvements to this guide, please feel free to submit issues or pull requests.