Building Qt 5.5 natively for Raspberry Pi on Debian Wheezy

25/09/2017 - 17:40
No votes yet

NOTE: This article is not ready yet

Wheezy is old and does not come with a usable version of Qt for any GUI application programming. Afaik there are no up-to-date backports so the only way to get the latest version of Qt (at time of writing, version 5.5.1) up and running on your Pi is to build it yourself. Building Qt on the Raspberry Pi is quite straightforward and in short consist of the following steps:

  1. Downloading sources
  2. Preparing the sources
  3. Installing dependencies
  4. Configuring the build
  5. Compiling
  6. Installing the build

This tutorial is written for version 5.5.1 but any later version should work just as well. Older versions are not recommended, but at least 5.4.2 works ok.

Download the Qt 5.5.1 source archive

Download the single source tar file from, version 5.5.1

Un-tar the source archive

Un-tar the source acrhive in a suitable location, with enough space. This will take quite a lot of time as the archive is quite big.

tar xf qt-everywhere-opensource-src-5.5.1.tar.xz

Create a shadow build directory outside of the source tree

mkdir build
cd build

Install build dependencies

You will need to install plenty of packages to be able to build Qt. Some packages are optional and depends on your needs.

Install required packages

apt-get install

Install optional packages

apt-get install tslib

Configure the build

The sources can be compiled so that the resulting build is usable on all versions of the Raspberry Pi, using only armv6 instructions or optimized for the Raspberry Pi 2+ with a much faster armv7 CPU core.

../qt-everywhere-opensource-src-5.5.1/configure \
 -v -opengl es2 \
 -device linux-rasp-pi-g++ \
 -device-option CROSS_COMPILE=/usr/bin/ \
 -opensource -confirm-license \
 -optimized-qmake -reduce-exports -force-pkg-config \
 -nomake examples -no-compile-examples \
 -skip qtwebkit -skip qtwebkit-examples \
 -release -qt-pcre -prefix /opt/Qt5.5.1

And compile

To compile just run make or if you are using the quad-core Pi, use make -j4 to build in parallel.

The compilation will take about 3 hours on a Quad-core Raspberry Pi 2, on the older single core version it will take a lot more time.

Install the build

make install

Compile a test program

Create a small test program to test basic functionality of the just installed Qt