Skip to content

QT Library Linux & Windows

Purpose

Installing the Qt-libraries on Linux for both Linux and Windows platforms to allow cross-compiling for Windows.

Installing on Linux

1) Create a Qt Account

To use an installer a Qt account is needed and is created on the register page.

2) Download Qt Installers

Open the installer page here which immediately starts downloading the Linux installer.
For the Windows version click on the 'Windows' link to start its download.

3) Run Installers

Linux Installer

Make the installer (qt-unified-linux-x64-?.?.?-online.run) executable using chmod +x *.run.
Run the installer ./qt-unified-linux-x64-?.?.?-online.run as a normal user and use ~/lib/Qt as the requested Installation Folder.

When selecting components use Latest supported releases.
From section Qt6.6.x select the components:

  • Desktop gcc 64-bit
  • QT Wayland Compositor

Windows Installer

2024-07: As of writing, the Windows installer qt-unified-windows-x64-?.?.?-online.exe cannot be run yet using Wine v9.0.
The only solution is to run it from a Windows VM and copy the result to a Linux filesystem.

To run the installer, sadly, the Windows OS system is needed.
Microsoft provides "Windows Development Environments" images for downloading.

For this a virtualizer is needed and VirtualBox and install a development environment downloaded from here.
To install the latest Virtualbox follow this page.

Share a folder in Linux with the VirtualBox Machine as a drive (R:) to the home directory so the Qt-installer can install it in R:\lib\QtWin.

3) Maintenance Tool for Qt Updates

When Qt updates its libraries and tools the Maintenance Tool can download them.

Linux

~/lib/Qt/MaintenanceTool

Windows

2024-07: The application MaintenanceTool.exe will not run on Wine v9.0 at this moment so only a Windows VM is the only option.

To run the Windows Qt Maintenance Tool Wine is needed and to install the latest stable version follow this page.

wine ~/lib/QtWin/MaintenanceTool.exe

4) Cross-compiling Fix/Hack for QtWin

To make the ~/lib/QtWin directory usable for cross-compiling Windows targets some things need to be fixed.

For this a script is available from this repository.

The script looks for the highest Linux Qt version directory ~/Qt/x.x.x and creates in the ~/QtWin/x.x.x directory symlinks for Linux executables and overwrites some .cmake files which are referring to .exe files.

With each new Qt version the script could be subject to change since Linux and Windows are diverted a bit.