Building Qt5.6 or Qt5.7 on Raspberry Pi3 or/and Pi zero

SPlatten picture SPlatten · May 5, 2016 · Viewed 21.3k times · Source

Is there a working guide on how to get Qt5.6 or even 5.5 built on the Raspberry Pi3?

I've found a number of guides on Wiki, that all seem incomplete in some way, the last one I tried was:

https://wiki.qt.io/RaspberryPi2EGLFS

Which was ok until I got to:

    ./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v

I'm not sure if its because its for a Pi2 but this errors with:

    The OpenGL ES 2.0 functionality test failed!
    You migh need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in /home/.../raspi/qtbase/mkspace/mkspecs/devices/linux-rasp-p2-g++.

I'm not sure how to progress further, thank you.

Edit, heres a bit more information:

I have a Raspberry Pi 3, running:

    Linux pi3 4.1.21.v7+ #872 SMP Wed Apr 6 17:34:14 BST 2016 armv71 GNU/Linux

The first error I see is: ./configure: 3497: ./configure: /home/simon/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: not found

I went to:

    ~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin

And typed: arm-linux-gnueabihf-g++

It wasn't installed, so then: sudo apt-get install g++-arm-linux-gnueabihf

Installation ok, then tried the configure instruction again, same result, still cannot find arm-linux-gnueabihf-g++

Edit 2016/06/12 ... I tried another source:

enter link description here

This also has problems, there are two libraries that are a problem:

    libjpeg62-dev and libxcb-sync0-dev

Can anyone refer me to information that is accurate and works?

Edit 2016/06/13, After following the information posted by RSATom, I tried both the information on the wiki page and downloading Qt, both result in the same when executing configure...

Running configuration tests (phase 2)... Failed to process makespec for platform 'devices/linux-rasp-pi2-g++' Project ERROR: Compiler /home/pi/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ not found. Check the value of CROSS_COMPILE -device-option Could not read qmake configuration file /home/pi/qtbase/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf. Error processing project file: /dev/null

make make: * No targets specified and no makefile found. Stop. pi@pi3:~/qtbase $ make install make: * No rule to make target 'install'. Stop.

2nd attempt, 2016/06/14...

OpenGL ES 2.0 disabled. The OpenGL ES 2.0 functionality test failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in /home/pi/raspi/qt5pi/qtbase/mkspecs/devices/linux-rasp-pi2-g++.

3rd attempt, 2016/06/15...

Ok, starting again from scratch and following the information on:

https://wiki.qt.io/RaspberryPi2EGLFS

First off, I checked my OS on the Pi 3:

    uname -a

Result:

    Linux pi3 4.4.9-v7+ #884 SMP Fri May 6 17:28:59 BST 2016 armv7l GNU/Linux

Then:

    lsb_release -a

Result:

    No LSB modules are available.
    Distributor ID: Raspbian
    Description:    Raspbian GNU/Linux 8.0 (jessie)
    Release:        8.0
    Codename:       jessie

Having established this I then jumped to step 3.

Step 4, I didn't read correctly the first time around, I don't want cross platform development I want to develop on the Pi 3 directly.

However I have Oracle VirtualBox running Version 5.0.20 r106931 with a Ubuntu virtual machine, started this, current release of Ubuntu:

    uname -a
    Linux simon-VirtualBox 3.19.0-59-generic #66-14.04.1-Ubuntu SMP Fri May 13 17:27:10 UTC 2016 x86_64 x84_64 GNU/Linuxu

    lsb_release -a
    No LSB modules are available.
    Dsitributor ID: Ubuntu
    Description:    Ubuntu 14.04.4 LTS
    Release:        14.04
    Codename:       trusty

Completed Steps 4, 5, 6.

Replaced link in Step 7 with:

    wget download.qt.io/official_releases/qt/5.6/5.6.0/single/qt-everywhere-opensource-src-5.6.0.tar.gz

Then extracted:

    tar -zxvf qt-everywhere-opensource-src-5.6.0.tar.gz

Once complete renamed folder 'qt-everywhere-opensource-src-5.6.0' to 'qtbase':

    mv qt-everywhere-opensource-src-5.6.0 qtbase

Then continued with Step 7 after the clone instruction at:

    cd qtbase

At this point lots of errors appear after a few seconds of scrolling messages, which end with:

    OpenGL ES 2.0 disabled.
    The OpenGL ES 2.0 functionality test failed!
     You might need to modify the include and library search paths by editing
     QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in

/home/simon/raspi/qtbase/qtbase/mkspecs/devices/linux-rasp-pi2-g++.

4th attempt, 2016/06/18...

Thanks to the efforts of RSATom, things have progressed some what.

I upgraded my installation of Jessie using:

    wget https://raw.githubusercontent.com/Topguy/Raspberry-Qt5-experiments/master/qt5_twolife_jessie_setup.sh

Make the downloaded script executable:

    chmod +x qt5_twolife_jessie_setup.sh

Execute the script:

    ./qt5_twolife_jessie_setup.sh

This will add a new repository for updating, update the system:

    sudo apt-get update
    sudo apt-get upgrade

Ensure you have all the required tools:

    sudo apt-get install build-essential

Ensure you have the required opengl components:

    sudo apt get install libgl1-mesa-dev libglu1-mesa-dev

Install qt5:

     sudo apt-get install qt5-default

Update the system again:

    sudo apt-get update
    sudo apt-get upgrade

This is where I am stuck as the system will not allow me to perform installation of qtcreator:

    sudo apt-get install qtcreator

It errors, and if I then reboot the Pi, it will not boot, I've performed this sequence twice and whilst it does appear to install Qt5.5, it is not complete and bricks the Pi, or at least will not boot until the SD card is re-flashed.

I'm now looking for a solution to this to find out why the Pi will not book after installing this update and why qtcreator will not install.

5th attempt, 2016/06/19...

Downloaded source of Qt5.7:

    wget http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.tar.gz

Extracted:

    tar -zxvf qt-everywhere-opensource-src-5.7.0.tar.gz

Thank you to dbmitch, for links:

Preparing Raspberry Pi 3

Its so frustrating, the above link looks very promising, but I cannot find any link to the mentioned Pi 3 Qt image.

2016/06/29 Found this today, looks promising, will try tonight: Building Your Own Embedded Linux Image

I'm fast running out of patience, having followed the instructions on the above link, I really don't think the authors of this page have tried it with the tools available on the links.

There are menu references in QtCreator that don't exist. It isn't easy to follow, do they want to promote usage of the product? I use the Qt environment at work daily and its excellent, but why is it so difficult to role out on what is supposed to be a supported platform?

2016/07/01 Sixth time lucky?...

Working through: Step by Step instructions

I simply changed 5.6 to 5.7 on this line:

    git clone git://code.qt.io/qt/qtbase.git -b 5.6

And it works...at least I'm building and making 5.7 on Ubuntu 16.04, when its finished I will rsync it across...I'll come back and post results.

See my answer...

Answer

SPlatten picture SPlatten · Jul 1, 2016

Finally success, follow this link:

Installing 5.6 step by step instructions

In the end I actually installed 5.7 and it works great! Just change the git pull argument from 5.6 to 5.7, thats it!

Big thanks go to RSATom