Build QtCreator 4.12 on Raspberry Pi

07/03/2021 - 22:58
Average: 4.1 (8 votes)

This tutorial will explain how to build a native QtCreator 4.12.2 to run on a Raspberry Pi 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 current version of Raspbian does not yet fullfill (LLVM 10 or 11).

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 QtCreator

Download QtCreator source archive

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

Unpack the QtCreator sources from the archive

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

Configure the QtCreator 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 QtCreator

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 QtCreator

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
Keywords: 
Qt, QtCreator, Raspberry Pi