Skip to content

Getting Started with Source and Builds

This topic explains how to get the QGroundControl source code and build it either natively or within a Vagrant environment. It also provides information about optional or OS specific functionality.

Daily Builds

If you just want to test (and not debug) a recent build of QGroundControl you can use the Daily Build. Versions are provided for all platforms.

Source Code

Source code for QGroundControl is kept on GitHub here: https://github.com/mavlink/qgroundcontrol. It is dual-licensed under Apache 2.0 and GPLv3.

To get the source files:

  1. Clone the repo (or your fork) including submodules:

    sh
    git clone --recursive -j8 https://github.com/mavlink/qgroundcontrol.git
  2. Update submodules (required each time you pull new source code):

    sh
    git submodule update --recursive

TIP

Github source-code zip files cannot be used because these do not contain the appropriate submodule source code. You must use git!

Build QGroundControl

Using Containers

We support Linux builds using a container found on the source tree of the repository, which can help you develop and deploy the QGC apps without having to install any of the requirements on your local environment.

Container Guide

Native Builds

QGroundControl builds are supported for macOS, Linux, Windows, and Android. Creating a version of QGC for iOS is theoretically possible but is no longer supported as a standard build. QGroundControl uses Qt as its cross-platform support library.

The required version of Qt is 6.6.3 (only).

WARNING

Do not use any other version of Qt! QGC has been thoroughly tested with the specified version of Qt (6.6.3). There is a significant risk that other Qt versions will inject bugs that affect stability and safety (even if QGC compiles).

For more information see: Qt 6 supported platform list.

INFO

Native CentOS Builds are also supported, but are documented separately (as the tested environment is different).

Install Qt

You must install Qt as described below instead of using pre-built packages from say, a Linux distribution.

To install Qt:

  1. Download and run the Qt Online Installer

    • Ubuntu:
      • Set the downloaded file to executable using: chmod +x.
      • You may also need to install libxcb-cursor.
  2. In the installer Select Components dialog choose: Qt 6.6.3.

    Then install the following components:

INFO

To see a complete list of all available components in the installer Select Components dialog, you might need to check the "Archive" box in the right column under the "Categories" tab, then click on "Filter".

  • Under _Qt 6.6.3 select:

    • Depending on the OS you want to build for:
      • Windows: MSVC 2019 64 bit
      • MacOS: macOS
      • Linux: Desktop gcc 64-bit
      • Android: Android
    • Qt 5 Compatibility Module
    • Qt Shader Tools
    • Qt Quick 3D
  • Under Additional Libraries select:

    • Qt Charts
    • Qt Connectivity
    • Qt Location (TP)
    • Qt Multimedia
    • Qt Positioning
    • Qt Sensors
    • Qt Serial Port
    • Qt Speech
  1. Install Additional Packages (Platform Specific)

    • Ubuntu: sudo bash ./qgroundcontrol/tools/setup/install-dependencies-debian.sh
    • Fedora: sudo dnf install speech-dispatcher SDL2-devel SDL2 systemd-devel patchelf
    • Arch Linux: pacman -Sy speech-dispatcher patchelf
    • OSX Setup
    • Android Setup
  2. Install Optional/OS-Specific Functionality

    INFO

    Optional features that are dependent on the operating system and user-installed libraries are linked/described below. These features can be forcibly enabled/disabled by specifying additional values to qmake.

Building using Qt Creator

INFO

QGC has switched to using cmake for builds. Qmake builds are currently deprecated and support will eventually be removed. Only custom builds continue to use qmake at this time, since they have not yet been converted to cmake.

  1. Launch Qt Creator, select Open Project and select the CMakeLists.txt file.

  2. In the Projects section, select the appropriate kit for your needs:

    • OSX: Desktop Qt 6.6.3 clang 64 bit

      INFO

      iOS builds must be built using XCode.

    • Ubuntu: Desktop Qt 6.6.3 GCC 64bit

    • Windows: Desktop Qt 6.6.3 MSVC2019 64bit

    • Android: Android for armeabi-v7a (GCC 4.9, Qt 6.6.3)

      • JDK17 is required for the latest updated versions. NDK Version: 25.1.8937393 You can confirm it is being used by reviewing the project setting: Projects > Manage Kits > Devices > Android (tab) > Android Settings > JDK location. Note: Visit here for more detailed configurations android.yml
  3. Build using the "hammer" (or "play") icons:

    QtCreator Build Button

Install Visual Studio 2019 (Windows Only)

The Windows compiler can be found here: Visual Studio 2019 compiler (64 bit)

When installing, select Desktop development with C++ as shown:

Visual Studio 2019 - Select Desktop Environment with C++

INFO

Visual Studio is ONLY used to get the compiler. Actually building QGroundControl should be done using Qt Creator or cmake as outlined below.

Build using cmake on CLI

Example commands to build a default QGC and run it afterwards:

  1. Make sure you cloned the repository and updated the submodules before, see chapter Source Code above and switch into the repository folder:

    sh
    cd qgroundcontrol
  2. Configure:

    sh
     cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
  3. Build

    sh
    cmake --build build --config Debug
  4. Run the QGroundcontrol binary that was just built:

    sh
    ./build/QGroundControl

Vagrant

Vagrant can be used to build and run QGroundControl within a Linux virtual machine (the build can also be run on the host machine if it is compatible).

  1. Download and Install Vagrant
  2. From the root directory of the QGroundControl repository run vagrant up
  3. To use the graphical environment run vagrant reload

Additional Build Notes for all Supported OS

  • Parallel builds: For non Windows builds, you can use the -j# option to run parellel builds.
  • If you get this error when running QGroundControl: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.20' not found., you need to either update to the latest gcc, or install the latest libstdc++.6 using: sudo apt-get install libstdc++6.
  • Unit tests: To run the unit tests, build in debug mode with UNITTEST_BUILD definition, and then copy deploy/qgroundcontrol-start.sh script into the debug directory before running the tests.

Building QGC Installation Files

You can additionally create installation file(s) for QGroundControl as part of the normal build process.

sh
cmake --install . --config Release