title: Building Qt5.6 or Qt5.7 on Raspberry Pi3 or/and Pi zero
body: <p>Is there a working guide on how to get Qt5.6 or even 5.5 built on the Raspberry Pi3?</p>
  
  <p>I've found a number of guides on Wiki, that all seem incomplete in some way, the last one I tried was:</p>
  
  <p><a href="https://wiki.qt.io/RaspberryPi2EGLFS" rel="noreferrer">https://wiki.qt.io/RaspberryPi2EGLFS</a></p>
  
  <p>Which was ok until I got to:</p>
  
  <pre><code>    ./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
  </code></pre>
  
  <p>I'm not sure if its because its for a Pi2 but this errors with:</p>
  
  <pre><code>    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++.
  </code></pre>
  
  <p>I'm not sure how to progress further, thank you.</p>
  
  <p>Edit, heres a bit more information:</p>
  
  <p>I have a Raspberry Pi 3, running:</p>
  
  <pre><code>    Linux pi3 4.1.21.v7+ #872 SMP Wed Apr 6 17:34:14 BST 2016 armv71 GNU/Linux
  </code></pre>
  
  <p>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</p>
  
  <p>I went to:</p>
  
  <pre><code>    ~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin
  </code></pre>
  
  <p>And typed:
          arm-linux-gnueabihf-g++</p>
  
  <p>It wasn't installed, so then:
          sudo apt-get install g++-arm-linux-gnueabihf</p>
  
  <p>Installation ok, then tried the configure instruction again, same result, still cannot find arm-linux-gnueabihf-g++</p>
  
  <p>Edit 2016/06/12 ...
  I tried another source:</p>
  
  <p><a href="https://wiki.qt.io/Native_Build_of_Qt5_on_a_Raspberry_Pi" rel="noreferrer">enter link description here</a></p>
  
  <p>This also has problems, there are two libraries that are a problem:</p>
  
  <pre><code>    libjpeg62-dev and libxcb-sync0-dev
  </code></pre>
  
  <p>Can anyone refer me to information that is accurate and works?</p>
  
  <p>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...</p>
  
  <p>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</p>
  
  <p>make
  make: <strong>* No targets specified and no makefile found.  Stop.
  pi@pi3:~/qtbase $ make install
  make: *</strong> No rule to make target 'install'.  Stop.</p>
  
  <h2>2nd attempt, 2016/06/14...</h2>
  
  <p>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++.</p>
  
  <h2>3rd attempt, 2016/06/15...</h2>
  
  <p>Ok, starting again from scratch and following the information on:</p>
  
  <p><a href="https://wiki.qt.io/RaspberryPi2EGLFS" rel="noreferrer">https://wiki.qt.io/RaspberryPi2EGLFS</a></p>
  
  <p>First off, I checked my OS on the Pi 3:</p>
  
  <pre><code>    uname -a
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>    Linux pi3 4.4.9-v7+ #884 SMP Fri May 6 17:28:59 BST 2016 armv7l GNU/Linux
  </code></pre>
  
  <p>Then:</p>
  
  <pre><code>    lsb_release -a
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>    No LSB modules are available.
      Distributor ID: Raspbian
      Description:    Raspbian GNU/Linux 8.0 (jessie)
      Release:        8.0
      Codename:       jessie
  </code></pre>
  
  <p>Having established this I then jumped to step 3.</p>
  
  <p>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.  </p>
  
  <p>However I have Oracle VirtualBox running Version 5.0.20 r106931 with a Ubuntu virtual machine, started this, current release of Ubuntu:</p>
  
  <pre><code>    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
  </code></pre>
  
  <p>Completed Steps 4, 5, 6.</p>
  
  <p>Replaced link in Step 7 with:</p>
  
  <pre><code>    wget download.qt.io/official_releases/qt/5.6/5.6.0/single/qt-everywhere-opensource-src-5.6.0.tar.gz
  </code></pre>
  
  <p>Then extracted:</p>
  
  <pre><code>    tar -zxvf qt-everywhere-opensource-src-5.6.0.tar.gz
  </code></pre>
  
  <p>Once complete renamed folder 'qt-everywhere-opensource-src-5.6.0' to 'qtbase':</p>
  
  <pre><code>    mv qt-everywhere-opensource-src-5.6.0 qtbase
  </code></pre>
  
  <p>Then continued with Step 7 after the clone instruction at:</p>
  
  <pre><code>    cd qtbase
  </code></pre>
  
  <p>At this point lots of errors appear after a few seconds of scrolling messages, which end with:</p>
  
  <pre><code>    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
  </code></pre>
  
  <p>/home/simon/raspi/qtbase/qtbase/mkspecs/devices/linux-rasp-pi2-g++.</p>
  
  <h2>4th attempt, 2016/06/18...</h2>
  
  <p>Thanks to the efforts of RSATom, things have progressed some what.</p>
  
  <p>I upgraded my installation of Jessie using:</p>
  
  <pre><code>    wget https://raw.githubusercontent.com/Topguy/Raspberry-Qt5-experiments/master/qt5_twolife_jessie_setup.sh
  </code></pre>
  
  <p>Make the downloaded script executable:</p>
  
  <pre><code>    chmod +x qt5_twolife_jessie_setup.sh
  </code></pre>
  
  <p>Execute the script:</p>
  
  <pre><code>    ./qt5_twolife_jessie_setup.sh
  </code></pre>
  
  <p>This will add a new repository for updating, update the system:</p>
  
  <pre><code>    sudo apt-get update
      sudo apt-get upgrade
  </code></pre>
  
  <p>Ensure you have all the required tools:</p>
  
  <pre><code>    sudo apt-get install build-essential
  </code></pre>
  
  <p>Ensure you have the required opengl components:</p>
  
  <pre><code>    sudo apt get install libgl1-mesa-dev libglu1-mesa-dev
  </code></pre>
  
  <p>Install qt5:</p>
  
  <pre><code>     sudo apt-get install qt5-default
  </code></pre>
  
  <p>Update the system again:</p>
  
  <pre><code>    sudo apt-get update
      sudo apt-get upgrade
  </code></pre>
  
  <p>This is where I am stuck as the system will not allow me to perform installation of qtcreator:</p>
  
  <pre><code>    sudo apt-get install qtcreator
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <h2>5th attempt, 2016/06/19...</h2>
  
  <p>Downloaded source of Qt5.7:</p>
  
  <pre><code>    wget http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.tar.gz
  </code></pre>
  
  <p>Extracted:</p>
  
  <pre><code>    tar -zxvf qt-everywhere-opensource-src-5.7.0.tar.gz
  </code></pre>
  
  <p>Thank you to dbmitch, for links:</p>
  
  <p><a href="http://doc.qt.io/QtEnterpriseEmbedded/qtee-preparing-hardware-rasberrypi.html" rel="noreferrer">Preparing Raspberry Pi 3</a></p>
  
  <p>Its so frustrating, the above link looks very promising, but I cannot find any link to the mentioned Pi 3 Qt image.</p>
  
  <p><strong>2016/06/29</strong> Found this today, looks promising, will try tonight:
  <a href="http://doc.qt.io/QtForDeviceCreation/qtee-custom-embedded-linux-image.html" rel="noreferrer">Building Your Own Embedded Linux Image</a></p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <h2>2016/07/01 Sixth time lucky?...</h2>
  
  <p>Working through: <a href="https://wiki.qt.io/RaspberryPi2EGLFS#Step_by_step" rel="noreferrer">Step by Step instructions</a></p>
  
  <p>I simply changed 5.6 to 5.7 on this line:</p>
  
  <pre><code>    git clone git://code.qt.io/qt/qtbase.git -b 5.6
  </code></pre>
  
  <p>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.</p>
  
  <p>See my answer...</p>