Qt for Linux - Building from Source | Qt 6.11
Description: How to configure and build Qt on Linux/X11 platforms.

- Qt 6.11
- Product information
- Supported Platforms
- Qt for Linux
- Qt for Linux - Building from Source
- Qt 6.11.1 Reference Documentation

Alternative ways of installing Qt ◦ Deployment

# Qt for Linux - Building from Source

This page describes configuring and building Qt for Linux from sources. Note that it is typically easier to install the pre-built Qt libraries and tools via Qt Online Installer. A lot of Linux distributions also provide Qt packages through their package manager. Build Qt from sources, however, if you want to customize Qt further or are using a distribution for which no binary Qt packages (in the right version) are available.

Distribution packagers can find further information on how to package Qt in the packaging recommendations.

## Step 1: Getting the Sources

Qt sources can be installed in Qt Online Installer. Source packages are also available through Git, as archives in the Qt Account (commercial users), and on download.qt.io (open-source users).

If you install the sources through Qt Online Installer, they will be available in the Qt installation directory, for example `$HOME/Qt/6.11.1/Src`.

If you downloaded the single source archive, extract it to a directory of your choice:

     cd /tmp
     tar xf ~/Downloads/qt-everywhere-src-6.11.1.tar.xz

## Step 2: Install Build Requirements

Building Qt requires a build environment with tools, compilers, and development packages.

### Build Tools

Tool | Supported Versions
--- | ---
CMake | Version 3.22 and newer.
Ninja | -
Python | Version 3

Note: configure always uses the Ninja generator and build tool if a `ninja` executable is available. Ninja is cross-platform, feature-rich, performant, and recommended on all platforms. The use of other generators might work but is not officially supported.

### Compilers & Development Packages

The following compilers and configurations are supported in Qt 6.11:

Distribution | Architecture | Compiler | Notes
--- | --- | --- | ---
Red Hat™ 8.10 | `x86_64` | GCC 10 (toolset) |
Red Hat 9.6 | `x86_64` | GCC 11 |
Red Hat 10.0 | `x86_64` | GCC 14 |
openSUSE 15.6 | `x86_64` | GCC 9, GCC 10, GCC 11, GCC 12 |
openSUSE 16.0 | `x86_64` | GCC 15 |
SUSE Linux Enterprise Server 15 SP6 | `x86_64` | GCC 11 |
Ubuntu 22.04 | `x86_64` | GCC as provided by Canonical, GCC 11.x | See also: Enterprise Qt Debian Packages.
Ubuntu 24.04 | `x86_64, arm64` | GCC as provided by Canonical, GCC 13.x | See the note regarding Linux on Arm desktop support.
Debian 11.6 | `x86_64, arm64` | GCC 10 | See the note regarding Linux on Arm desktop support.
Debian 12 | `x86_64, arm64` | GCC 12 | See also: Enterprise Qt Debian Packages. See the note regarding Linux on Arm desktop support.

Note: For Linux on Arm on desktops, we use Raspberry Pi 5 with 8GB RAM and Ubuntu 24.04 as a reference platform. If you have an issue with another hardware, please try to reproduce the issue on Raspberry Pi 5. We plan to move to regular platform support when a wider range of ARM-based desktop hardware becomes available. The official binaries in Qt Online Installer are built on Ubuntu 24.04 which ships with glibc 2.39, if your glibc is older than what we build with, you need to rebuild from sources.

Other compilers and configurations might work but are not actively tested.

Qt also relies on the availability of various libraries and development packages, which are typically installed by the package manager of the respective resolution. See Qt for Linux - Requirements for the details.

## Step 3: Build the Qt Libraries and Tools

To configure your build, create a build directory and run the `./configure` script in this directory:

     mkdir -p ~/dev/qt-build
     cd ~/dev/qt-build
     /tmp/qt-everywhere-src-6.11.1/configure

By default, Qt is configured for installation in the `/usr/local/Qt-6.11.1` directory. This can be changed by using the `-prefix` option. See the list of configure options to tweak further.

Did `configure` run successfully? Then proceed with building the libraries and tools:

     cmake --build . --parallel

After building, you need to install the libraries and tools in the appropriate place (unless you enabled a developer build):

     cmake --install .

Note that this might require root access.

## Step 4: Building Your Application

After Qt is installed, you can start building applications with it.

If you work from the command line, consider adding the Qt tools to your default `PATH`. This is done as follows:

In `.profile` (if your shell is bash, ksh, zsh or sh), add the following lines:

     PATH=/usr/local/Qt-6.11.1/bin:$PATH
     export PATH

In `.login` (if your shell is csh or tcsh), add the following line:

     setenv PATH /usr/local/Qt-6.11.1/bin:$PATH

If you plan to use Qt from an IDE, you need to register the Qt version explicitly there. For Qt Creator, see Qt Creator: Add Qt versions.

Alternative ways of installing Qt ◦ Deployment