Build Qt Creator 4.12 on Raspberry Pi

How to build a native Qt Creator 4.12.2 to run on a Raspberry Pi (pre-bookworm versions) using Qt 5 branch.

Changed

This tutorial will explain how to build a native Qt Creator 4.12.2 to run on a Raspberry Pi (pre-bookworm versions) using Qt 5.12 or later. You might wonder, "Why 4.12, isn't that old already ?". It is, the latest releases are in the 4.14 branch, but unfortunately it has build dependencies that the older versions of Raspbian didn't fullfill (LLVM 10 or 11).

Note: This tutorial is for old versions of Raspberry Pi OS / Raspbian and for the old Qt 5 branch. A new tutorial targeting Qt Creator with Qt 6 is in the works.

First steps

Remove any installed Qt packages

For some reason installed Qt libraries might cause link failures, so we need to get rid of them first. So if you have an older Qt 5 already installed from distro packages, remove them first with apt:

apt remove <list-all-installed-qt-packages-here>

Build and install Qt 5.12 or later

First you need to various build tool and of course build Qt 5 for your Raspberry Pi, for example if using Qt 5.12, follow this Qt build tutorial for instructions on how to install required packages and building of Qt 5. Note that the deprecated QtScript module is required for QtCreator, so make sure you enable it when building Qt 5. Or have it built separately.

When you have done that succesfully, come back here.

Install required packages

No need to install other that Qt 5 and what it requires for building.

Build Qt Creator

Download Qt Creator source archive

wget https://download.qt.io/archive/qtcreator/4.12/4.12.4/qt-creator-opensource-src-4.12.4.tar.xz

Unpack the Qt Creator sources from the archive

tar xf qt-creator-opensource-src-4.12.4.tar.xz

Configure the Qt Creator build

Run qmake against the sources. We will assume that Qt 5.12.10 is installed in /opt/Qt/5.12.10 (and if not, adjust the path for your installation)

cd qt-creator-opensource-src-4.12.4
/opt/Qt/5.12.10/bin/qmake -r

Compile Qt Creator

Next start the compilation. This will take a while

make -j4

Install QtCreator

Next install the just built QtCreator, you can use whatever path you like, I prefer installing custom software under /opt.

make install INSTALL_ROOT=/opt/Qt/QtCreator4.12

Run Qt Creator

You should now be able to start QtCreator with (running under X11):

/opt/Qt/QtCreator4.12/bin/qtcreator -platform xcb

You can also run it without X11, in that case just run without the platform parameter:

/opt/Qt/QtCreator4.12/bin/qtcreator