Build Instructions for GitHub - chronic8000/aqemu: AQEMU - Qt frontend for QEMU. Maintained by Chronic Engineering (Windows & Linux). GPLv2. · GitHub
This assumes you are using vscode and I will be using my default locations
Also we will not be bundling QEMU, I will use https://qemu.weilnetz.de/w64/
Setup Dependencies
- Git for Windows
- MSYS2
- Install to:
D:\libs\msys64
- After installing, open MSYS2 UCRT64 from the Start menu. In the terminal run
pacman -Syu
- this updates stuff
- select yes when prompted
- the terminal will probably close when finished
- Reopen MSYS2 UCRT64, and re-run the command again to do further updates
- Then install the build tools:
pacman -S --needed mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-pkgconf mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-spice-gtk mingw-w64-ucrt-x86_64-gobject-introspection mingw-w64-ucrt-x86_64-libvncserver mingw-w64-ucrt-x86_64-qt5-base
- select yes when prompted
- we can now close this terminal
- Make the MSYS2 UCRT64 tools available to VS Code (including gcc, pkgconf, ninja, spice) I have added it temp in the build script for now
- If you only want it for the current PowerShell window, this is much easier:
$env:Path += ";D:\libs\msys64\ucrt64\bin"
- If you want it permanently, Windows has a built-in command:
setx PATH "$($env:PATH);D:\libs\msys64\ucrt64\bin"
- If you only want it for the current PowerShell window, this is much easier:
- Notes
- The important part here is that we're using the UCRT64
- Setup build environment — QEMU 10.0.3 documentation
- QEMU itself also recommends MSYS2/MinGW environments for Windows builds.
- Install to:
- Qt for MiniGW
- Qt says: We recommend you use the Qt Online Installer for first time installations and the Qt Maintenance Tool for changes to a current install.
- Download
- https://qt.io/download-qt-installer
- https://d13lb3tujbc8s0.cloudfront.net/onlineinstallers/qt-online-installer-windows-x64-4.11.0.exe
- https://www.qt.io/development/download-qt-installer-oss
- offline and online installers available here of OSS projects
- Install
- Create an account if needed
- Login with your account
- Install to:
D:\libs\Qt
- Don't install the MSVC version of Qt.
- Deselect `Qt 6.11 for desktop development`
- Select Custom Installation and pick
- Show
archive versionsusing the toggle at the top right - Select only
- Qt for Development --> Qt --> Qt 5.15.2 --> MinGW 13.1.0 64-bit
- Show
- Select `Qt 6.11 for desktop development`
- This is installing (maybe to its own system use)
- MinGW
- CMake
- Ninja
- Qt
- This is installing (maybe to its own system use)
- Don’t associate common file types with Qt Creator
- NB: I am not sure if I need all of the programs
- Cmake
- Install
- Use the Windows installer.
- Add CMake to the system PATH (the installer does this for you, but you need to reboot)
- Notes
- I used cmake for for making notepad++ plugin
C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin
- I used cmake for for making notepad++ plugin
- Install
- WinLibs - GCC+MinGW-w64 compiler for Windows
- WinLibs standalone build of GCC and MinGW-w64 for Windows
- What is it? In short: it's a free C and C++ compiler for Microsoft Windows.
- I don't think I have needed it yet with this project.
Setup VSCode Project
- Create a project folder
D:\websites\htdocs\projects\standalone\aqemu
- Open the project folder in VSCode
- Clone the aqemu GitHub Repository
git clone --recursive https://github.com/chronic8000/aqemu.git .
- The --recursive is important because the repository has submodules, including the optional QEMU source tree.
- If you are not bundling QEMU the submodules might not be needed
- Add a `localonly` folder
- create the folder and add an exception in htaccss
- Put all the downloaded assets in here
- Create a build folder
D:\websites\htdocs\projects\standalone\aqemu\build_win
Build Instructions
We are still in VScode in the aqemu workspace
- This builds: WinLibs UCRT MinGW + Qt 5.15; SPICE from MSYS2 ucrt64 via
PKG_CONFIG_PATHonly.$env:Path += ";D:\libs\msys64\ucrt64\bin"is added because I have not added MSYS2 to my windowsPATH.- cmake needs to use forward slashes (/)
- CMP0207 — CMake 4.4.3 Documentation
- CMake 4.3 and above prefer to normalize paths to use forward slashes before matching.
- This policy provides compaitiblity for projects that may have been relying on matching backslashes only.
- Run this powershell script
$env:Path += ";D:\libs\msys64\ucrt64\bin" $env:PKG_CONFIG_PATH = "D:\libs\msys64\ucrt64\lib\pkgconfig" mkdir build_win -Force; cd build_win cmake -G Ninja ` -DCMAKE_PREFIX_PATH="D:/libs/Qt/5.15.2/mingw81_64" ` -DAQEMU_WITH_SPICE_GTK=ON ` .. ninja .\aqemu.exe
- Add the ucrt64\bin folder temporarily to the environmental PATH variable This is an issue becasue of its placement in the path chain)
- Adds to
PKG_CONFIG_PATHto the environmental variables. It is not persistent - makes a folder called
build_winand then moves to it cmakeis essentially the project's own Windows build command.ninjacompiles the binary
First script that works from claude
$ErrorActionPreference = 'Stop'
$repo = 'D:\websites\htdocs\projects\standalone\aqemu'
# ucrt64 first on PATH so its gcc/ninja/pkg-config win over anything else installed
$env:Path = "D:\libs\msys64\ucrt64\bin;$env:Path"
$env:PKG_CONFIG_PATH = "D:\libs\msys64\ucrt64\lib\pkgconfig"
cmake -G Ninja `
-DCMAKE_PREFIX_PATH="D:/libs/msys64/ucrt64" `
-DAQEMU_WITH_SPICE_GTK=ON `
-S $repo -B "$repo\build_win"
if ($LASTEXITCODE -ne 0) { throw "cmake configure failed" }
ninja -C "$repo\build_win"
if ($LASTEXITCODE -ne 0) { throw "ninja build failed" }
& "$repo\build_win\aqemu.exe"
- -DCMAKE_PREFIX_PATH="D:/libs/Qt/5.15.2/mingw81_64" ` also works.
PowerShell Build Scripts (from claude)
- Why do i have build.ps1 and package_win.ps1? do they do the same thing, is there functionality cross over?
- They're two stages of one pipeline, not duplicates:
- build.ps1 — configures CMake and runs
ninjato compileaqemu.exeintobuild_win\.At the end it callspackage_win.ps1for you (build.ps1:48). - package_win.ps1 — takes the already-built
build_win\aqemu.exeand turns it into a portable folder: copies the binary, pulls in Qt plugins, walks the DLL import tree recursively to bundle every dependency, verifies nothing's unresolved, and optionally zips it up.
- build.ps1 — configures CMake and runs
- So there's no real overlap in what they do —
build.ps1handles compiling,package_win.ps1handles packaging — they're just chained together so.\build.ps1alone gets you from source to a distributabledist\aqemu\folder. The reasonpackage_win.ps1exists standalone is so you can re-package without a full rebuild (e.g. after just touching Qt plugins or DLL logic), via.\package_win.ps1 -Zip. - So You don't actually have to run both manually —
build.ps1already callspackage_win.ps1for you at the end, passing along your-Zipswitch: - You'd only run
package_win.ps1by itself if you wanted to re-package without rebuilding (e.g. you didn't touch source code but want to re-verify DLLs or just re-zip).
- They're two stages of one pipeline, not duplicates:
- Here's what .\build.ps1 -Zip actually does:
- Runs cmake configure and ninja -C build_win — this is an incremental build. If build_win\ already exists with prior build artifacts, ninja only rebuilds what changed (like any normal build). It does NOT wipe/rebuild everything from scratch.
- Calls package_win.ps1 -Zip, which packages whatever build_win\aqemu.exe currently is into dist\aqemu\, then zips that folder to dist\aqemu-win64.zip.
- What should I run?
.\build.ps1 -Zip
- This will recompile and build the
/dist/aqemu-win64.zip
- This will recompile and build the
- To force a true from-scratch build, you need -Clean too:
.\build.ps1 -Clean -Zip
- This wipes
build_win\first (build.ps1:40), then reconfigures, rebuilds everything, and zips the result.
- This wipes
Notes
- This directory is hardcoded in
CMakeLists.txttwice for spiceC:/msys64/ucrt64/bin
- This directory is hardcoded in
scripts/build_img4_windows.ps1C:\msys64\ucrt64\bin
Troubleshooting
- QT not found
- Cause
- in AQEMU the `platforms` folder was missing
- Notes
- Look ow the dlls are structured in the other Qt Frontend packages. All the dll are in the root and some of the WT ones are in folders.
- Links
- How to resolve "no Qt Platform Plugin could be initialized" for a Qt5 application? | Stack Overflow
- How to Fix the “Application Failed to Start Because No Qt Platform Plugin Could Be Initialized” Error - Get this somewhat strange error message fixed on Windows
- Cause
- When running the wizard, it can take a while between steps
- This is only with my build, just wait longer.