Native build of qt5 on a raspberry pi: Difference between revisions
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
Install packages needed for compiling:<br /><code>sudo apt-get update<br />sudo apt-get upgrade<br />sudo apt-get install libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev gstreamer-tools gstreamer0.10-plugins-good gstreamer0.10-plugins-bad libraspberrypi-dev libpulse-dev libx11-dev libglib2.0-dev libcups2-dev freetds-dev libsqlite0-dev libpq-dev libiodbc2-dev libmysqlclient-dev firebird-dev libpng12-dev libjpeg62-dev libgst-dev libxext-dev libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxi-dev libdrm-dev</code> | Install packages needed for compiling:<br /><code>sudo apt-get update<br />sudo apt-get upgrade<br />sudo apt-get install libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev gstreamer-tools gstreamer0.10-plugins-good gstreamer0.10-plugins-bad libraspberrypi-dev libpulse-dev libx11-dev libglib2.0-dev libcups2-dev freetds-dev libsqlite0-dev libpq-dev libiodbc2-dev libmysqlclient-dev firebird-dev libpng12-dev libjpeg62-dev libgst-dev libxext-dev libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxi-dev libdrm-dev</code> | ||
Then make your build directory:<br /><code>mkdir | Then make your build directory:<br /><code>mkdir ~/opt<br />cd~/opt</code> | ||
Retrieve qt5 source code from git:<br /><code>git clone git://gitorious.org/qt/qt5.git<code> | Retrieve qt5 source code from git:<br /><code>git clone git://gitorious.org/qt/qt5.git<code> | ||
Line 17: | Line 17: | ||
Do not apply any patches that are available out there. They are no longer necessary with the latest Qt5. The git source should compile with a few tricks in the configure parameters without any patches. | Do not apply any patches that are available out there. They are no longer necessary with the latest Qt5. The git source should compile with a few tricks in the configure parameters without any patches. | ||
First make sure you are in the qt5 directory.<br /></code>cd | First make sure you are in the qt5 directory.<br /></code>cd ~/opt/qt5</code> | ||
<br />In order to get the configure script to build all of the Makefiles correctly you will need to tweak your | <br />In order to get the configure script to build all of the Makefiles correctly you will need to tweak your~/opt/qt5/qtbase/configure script. Use your favorite text editor (vim, nano, emacs) and change/add the following code in the ~/opt/qt5/qtbase/configure script (search for QT_CFLAGS_DBUS):<br /><code># flags for raspberry pi build<br /># flags for libdbus-1<br />QT_CFLAGS_DBUS="-I/usr/include/dbus-1.0/ -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include/"<br />QT_LIBS_DBUS=-ldbus-1 | ||
<br /># flags for Glib (X11 only)<br />QT_CFLAGS_GLIB= | <br /># flags for Glib (X11 only)<br />QT_CFLAGS_GLIB="-I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/"<br />QT_LIBS_GLIB=-lglib-2.0 | ||
<br />QT_CFLAGS_PULSEAUDIO= | <br />QT_CFLAGS_PULSEAUDIO="-I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/"<br />QT_LIBS_PULSEAUDIO="-lpulse -lpulse-mainloop-glib" | ||
<br /># flags for GStreamer (X11 only)<br />QT_CFLAGS_GSTREAMER= | <br /># flags for GStreamer (X11 only)<br />QT_CFLAGS_GSTREAMER="-I/usr/include/gstreamer-0.10/ -I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/ -I/usr/include/libxml2/"<br />QT_LIBS_GSTREAMER=</code> | ||
<br />Then before closing the file search for QT_CFLAGS_FONTCONFIG in the configure script. It should be below the above entries, you need to change the one in the else statement to this:<br /><code>QT_CFLAGS_FONTCONFIG=-I/usr/include/freetype2/<code> | <br />Then before closing the file search for QT_CFLAGS_FONTCONFIG in the configure script. It should be below the above entries, you need to change the one in the else statement to this:<br /><code>QT_CFLAGS_FONTCONFIG=-I/usr/include/freetype2/<code> | ||
<br />If the above changes are hard to follow then you can use the following patch file:<br /></code>1030,1031c1030,1031<br /> | <br />If the above changes are hard to follow then you can use the following patch file:<br /></code>1030,1031c1030,1031<br />< QT_CFLAGS_DBUS=<br />< QT_LIBS_DBUS=<br />—<br />> QT_CFLAGS_DBUS="-I/usr/include/dbus-1.0/ -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include/"<br />> QT_LIBS_DBUS=-ldbus-1<br />1034,1035c1034,1038<br />< QT_CFLAGS_GLIB=<br />< QT_LIBS_GLIB=<br />—<br />> QT_CFLAGS_GLIB="-I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/"<br />> QT_LIBS_GLIB=-lglib-2.0<br />><br />> QT_CFLAGS_PULSEAUDIO="-I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/"<br />> QT_LIBS_PULSEAUDIO="-lpulse -lpulse-mainloop-glib"<br />1038c1041<br />< QT_CFLAGS_GSTREAMER=<br />—<br />> QT_CFLAGS_GSTREAMER="-I/usr/include/gstreamer-0.10/ -I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/ -I/usr/include/libxml2/"<br />5123c5126<br />< QT_CFLAGS_FONTCONFIG=<br />—<br />> QT_CFLAGS_FONTCONFIG=-I/usr/include/freetype2/<code> | ||
<br />In order to properly run configure for Qt5 on the Raspberry Pi, you need to point the CROSS_COMPILE variable to the native compiler located at /usr/bin/g+''. The CROSS_COMPILE parameter is the path to the compiler (without the g). If you do not do this properly it will complain that it is not being cross compiled. | <br />In order to properly run configure for Qt5 on the Raspberry Pi, you need to point the CROSS_COMPILE variable to the native compiler located at /usr/bin/g+''. The CROSS_COMPILE parameter is the path to the compiler (without the g). If you do not do this properly it will complain that it is not being cross compiled. | ||
<br />All output is stored in the file called ‘output’ in case something goes wrong. At the end of the output file it should say you can run ‘make’, if not look for errors at the end of the output. | <br />All output is stored in the file called ‘output’ in case something goes wrong. At the end of the output file it should say you can run ‘make’, if not look for errors at the end of the output. | ||
<br />Do not be concerned with some things not building due to missing packages, there will be errors for those. If it does not mention that you can run make then check the last error, it is generally the show-stopper.<br />Run configure:<br /></code>./configure -v -opengl es2 -device linux-rasp-pi-g''+ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -make libs -prefix /usr/local/qt5 & | <br />Do not be concerned with some things not building due to missing packages, there will be errors for those. If it does not mention that you can run make then check the last error, it is generally the show-stopper.<br />Run configure:<br /></code>./configure -v -opengl es2 -device linux-rasp-pi-g''+ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -make libs -prefix /usr/local/qt5 &> output</code> | ||
<br />Check the output file to see that it is building the components you need (towards the end of the output it will have Yes next to the Qt Components that will be built) and it should say that you can now run 'make'. | <br />Check the output file to see that it is building the components you need (towards the end of the output it will have Yes next to the Qt Components that will be built) and it should say that you can now run 'make'. | ||
<br />Example from 'output' file:<br /><code>…<br />Build options:<br /> Configuration ………. accessibility accessibility-atspi-bridge alsa audio-backend c+''11 clock-gettime clock-monotonic concurrent cross_compile cups dbus egl eglfs evdev eventfd fontconfig full-config getaddrinfo getifaddrs glib gstreamer iconv icu inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap neon nis no-pkg-config opengl opengles2 openssl pcre png precompile_header pulseaudio qpa qpa reduce_exports reduce_relocations release rpath shared small-config system-freetype system-jpeg system-png system-zlib v8 v8snapshot xcb xcb-glx xcb-render xcb-xlib xinput2 xkbcommon-qt xlib xrender<br /> Build parts ………… libs<br /> Mode ………………. release<br /> Using C''+11 ………… yes<br /> Using PCH ………….. yes<br /> Target compiler supports:<br /> iWMMXt/Neon ………. no/yes | <br />Example from 'output' file:<br /><code>…<br />Build options:<br /> Configuration ………. accessibility accessibility-atspi-bridge alsa audio-backend c+''11 clock-gettime clock-monotonic concurrent cross_compile cups dbus egl eglfs evdev eventfd fontconfig full-config getaddrinfo getifaddrs glib gstreamer iconv icu inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap neon nis no-pkg-config opengl opengles2 openssl pcre png precompile_header pulseaudio qpa qpa reduce_exports reduce_relocations release rpath shared small-config system-freetype system-jpeg system-png system-zlib v8 v8snapshot xcb xcb-glx xcb-render xcb-xlib xinput2 xkbcommon-qt xlib xrender<br /> Build parts ………… libs<br /> Mode ………………. release<br /> Using C''+11 ………… yes<br /> Using PCH ………….. yes<br /> Target compiler supports:<br /> iWMMXt/Neon ………. no/yes | ||
Line 35: | Line 35: | ||
<br />Prior to reconfiguration, make sure you remove any leftovers from<br />the previous build.</code> | <br />Prior to reconfiguration, make sure you remove any leftovers from<br />the previous build.</code> | ||
<br />Note, the compilation will take about two days to compile overclocked at 900 MHz. If you are logged in remotely consider using byobu or screen so that you can detach your session. | <br />Note, the compilation will take about two days to compile overclocked at 900 MHz. If you are logged in remotely consider using byobu or screen so that you can detach your session. | ||
<br />Then you need to run make as follows (check for errors in the output_make file):<br /><code>make & | <br />Then you need to run make as follows (check for errors in the output_make file):<br /><code>make &> output_make<code> | ||
<br />If that is good then run make install (check for errors in the output_make_install file):<br /></code>sudo make install & | <br />If that is good then run make install (check for errors in the output_make_install file):<br /></code>sudo make install &> output_make_install</code> | ||
<br />After this you need to add some lines to your .bashrc file:<br /><code>export LD_LIBRARY_PATH=/usr/local/qt5/lib/<br />export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/qt5/bin</code> | <br />After this you need to add some lines to your .bashrc file:<br /><code>export LD_LIBRARY_PATH=/usr/local/qt5/lib/<br />export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/qt5/bin</code> | ||
<br />You need to source your .bashrc file to set-up the above environment variables:<br /><code>source | <br />You need to source your .bashrc file to set-up the above environment variables:<br /><code>source~/.bashrc<code> | ||
Then run this and check that it points to /usr/local/qt5/bin/qmake<br /></code>which qmake</code> | Then run this and check that it points to /usr/local/qt5/bin/qmake<br /></code>which qmake</code> | ||
Example output:<br /><code>pi<code>raspberrypi | Example output:<br /><code>pi<code>raspberrypi ~/opt/qt5 $ which qmake<br />/usr/local/qt5/bin/qmake</code> | ||
<br />After this you should be able to compile the sample applications and run them. Try the OpenGL Cube (I have not tested this in X windows, only from the console):<br /><code>cp -r | <br />After this you should be able to compile the sample applications and run them. Try the OpenGL Cube (I have not tested this in X windows, only from the console):<br /><code>cp -r~/opt/qt5/qtbase/examples/opengl/cube ~/<br />cd~/cube<br />qmake<br />make<br />./cube</code> |
Revision as of 06:52, 25 February 2015
h1. Native Build of Qt 5 on a Raspberry Pi
There are many tutorials online for building Qt5 on the Raspberry Pi, but all or most of those tutorials are for using a desktop machine to cross compile the binaries for the Raspberry Pi. You will not be able to run qmake and make on the Raspberry Pi itself if you cross compile. This tutorial is meant to show you how to natively compile Qt 5 on the Raspberry Pi so that you can use qmake and make on the Raspberry Pi itself without cross compiling or relying on an external desktop.
First start off by obtaining either the latest version of Raspbian or the May 23rd version (the one I used for this tutorial). You will need at least an 8GB SD card because the space required is a bit over 4GB. Also make sure you are using the Model B or B+ with 512MB RAM. The early Raspberry Pis were shipped with 256 MB RAM which isn't sufficient and will result in an gcc error.
Turn on your Raspberry Pi and log in. Make sure you have it connected properly to the internet and that you have a power supply that is at least 1A. You may also want to overclock your Pi. I overclocked mine at 900 MHz and it took 38 hours to compile and the temperature was a steady 51 C - 54 C (with case, no heat-sinks, no fans).
Install packages needed for compiling:
sudo apt-get update<br />sudo apt-get upgrade<br />sudo apt-get install libfontconfig1-dev libdbus-1-dev libfreetype6-dev libudev-dev libicu-dev libsqlite3-dev libxslt1-dev libssl-dev libasound2-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev gstreamer-tools gstreamer0.10-plugins-good gstreamer0.10-plugins-bad libraspberrypi-dev libpulse-dev libx11-dev libglib2.0-dev libcups2-dev freetds-dev libsqlite0-dev libpq-dev libiodbc2-dev libmysqlclient-dev firebird-dev libpng12-dev libjpeg62-dev libgst-dev libxext-dev libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxi-dev libdrm-dev
Then make your build directory:
mkdir ~/opt<br />cd~/opt
Retrieve qt5 source code from git:
git clone git://gitorious.org/qt/qt5.git<code>
Retrieve git sources for other components<br />
cd qt5
./init-repository
Do not apply any patches that are available out there. They are no longer necessary with the latest Qt5. The git source should compile with a few tricks in the configure parameters without any patches.
First make sure you are in the qt5 directory.<br />
cd ~/opt/qt5
In order to get the configure script to build all of the Makefiles correctly you will need to tweak your~/opt/qt5/qtbase/configure script. Use your favorite text editor (vim, nano, emacs) and change/add the following code in the ~/opt/qt5/qtbase/configure script (search for QT_CFLAGS_DBUS):
# flags for raspberry pi build<br /># flags for libdbus-1<br />QT_CFLAGS_DBUS="-I/usr/include/dbus-1.0/ -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include/"<br />QT_LIBS_DBUS=-ldbus-1
<br /># flags for Glib (X11 only)<br />QT_CFLAGS_GLIB="-I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/"<br />QT_LIBS_GLIB=-lglib-2.0
<br />QT_CFLAGS_PULSEAUDIO="-I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/"<br />QT_LIBS_PULSEAUDIO="-lpulse -lpulse-mainloop-glib"
<br /># flags for GStreamer (X11 only)<br />QT_CFLAGS_GSTREAMER="-I/usr/include/gstreamer-0.10/ -I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/ -I/usr/include/libxml2/"<br />QT_LIBS_GSTREAMER=
Then before closing the file search for QT_CFLAGS_FONTCONFIG in the configure script. It should be below the above entries, you need to change the one in the else statement to this:
QT_CFLAGS_FONTCONFIG=-I/usr/include/freetype2/<code>
<br />If the above changes are hard to follow then you can use the following patch file:<br />
1030,1031c1030,1031
< QT_CFLAGS_DBUS=
< QT_LIBS_DBUS=
—
> QT_CFLAGS_DBUS="-I/usr/include/dbus-1.0/ -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include/"
> QT_LIBS_DBUS=-ldbus-1
1034,1035c1034,1038
< QT_CFLAGS_GLIB=
< QT_LIBS_GLIB=
—
> QT_CFLAGS_GLIB="-I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/"
> QT_LIBS_GLIB=-lglib-2.0
>
> QT_CFLAGS_PULSEAUDIO="-I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/"
> QT_LIBS_PULSEAUDIO="-lpulse -lpulse-mainloop-glib"
1038c1041
< QT_CFLAGS_GSTREAMER=
—
> QT_CFLAGS_GSTREAMER="-I/usr/include/gstreamer-0.10/ -I/usr/include/glib-2.0/ -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include/ -I/usr/include/libxml2/"
5123c5126
< QT_CFLAGS_FONTCONFIG=
—
> QT_CFLAGS_FONTCONFIG=-I/usr/include/freetype2/
<br />In order to properly run configure for Qt5 on the Raspberry Pi, you need to point the CROSS_COMPILE variable to the native compiler located at /usr/bin/g+''. The CROSS_COMPILE parameter is the path to the compiler (without the g). If you do not do this properly it will complain that it is not being cross compiled.
<br />All output is stored in the file called ‘output’ in case something goes wrong. At the end of the output file it should say you can run ‘make’, if not look for errors at the end of the output.
<br />Do not be concerned with some things not building due to missing packages, there will be errors for those. If it does not mention that you can run make then check the last error, it is generally the show-stopper.<br />Run configure:<br />
./configure -v -opengl es2 -device linux-rasp-pi-g+ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -optimized-qmake -reduce-exports -release -qt-pcre -make libs -prefix /usr/local/qt5 &> output
Check the output file to see that it is building the components you need (towards the end of the output it will have Yes next to the Qt Components that will be built) and it should say that you can now run 'make'.
Example from 'output' file:
…<br />Build options:<br /> Configuration ………. accessibility accessibility-atspi-bridge alsa audio-backend c+''11 clock-gettime clock-monotonic concurrent cross_compile cups dbus egl eglfs evdev eventfd fontconfig full-config getaddrinfo getifaddrs glib gstreamer iconv icu inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap neon nis no-pkg-config opengl opengles2 openssl pcre png precompile_header pulseaudio qpa qpa reduce_exports reduce_relocations release rpath shared small-config system-freetype system-jpeg system-png system-zlib v8 v8snapshot xcb xcb-glx xcb-render xcb-xlib xinput2 xkbcommon-qt xlib xrender<br /> Build parts ………… libs<br /> Mode ………………. release<br /> Using C''+11 ………… yes<br /> Using PCH ………….. yes<br /> Target compiler supports:<br /> iWMMXt/Neon ………. no/yes
<br />Qt modules and options:<br /> Qt D-Bus …………… yes (loading dbus-1 at runtime)<br /> Qt Concurrent ………. yes<br /> Qt GUI …………….. yes<br /> Qt Widgets …………. yes<br /> JavaScriptCore JIT ….. yes (To be decided by JavaScriptCore)<br /> QML debugging ………. yes<br /> Use system proxies ….. no
<br />Support enabled for:<br /> Accessibility ………. yes<br /> ALSA ………………. yes<br /> CUPS ………………. yes<br /> FontConfig …………. yes<br /> Iconv ……………… yes<br /> ICU ……………….. yes<br /> Image formats:<br /> GIF ……………… yes (plugin, using system library)<br /> JPEG …………….. yes (plugin, using system library)<br /> PNG ……………… yes (in QtGui, using system library)<br /> Glib ………………. yes<br /> GStreamer ………….. yes<br /> GTK theme ………….. no<br /> Large File …………. yes<br /> libudev ……………. yes<br /> Networking:<br /> getaddrinfo ………. yes<br /> getifaddrs ……….. yes<br /> IPv6 ifname ………. yes<br /> OpenSSL ………….. yes (loading libraries at run-time)<br /> NIS ……………….. yes<br /> OpenGL …………….. yes (OpenGL ES 2.x)<br /> OpenVG …………….. no<br /> PCRE ………………. yes (bundled copy)<br /> pkg-config …………. no<br /> PulseAudio …………. yes<br /> QPA backends:<br /> DirectFB …………. no<br /> EGLFS ……………. yes<br /> KMS ……………… no<br /> LinuxFB ………….. yes<br /> XCB ……………… yes (system library)<br /> MIT-SHM ………… yes<br /> Xcursor ………… yes (loaded at runtime)<br /> Xfixes …………. yes (loaded at runtime)<br /> Xi …………….. no<br /> Xi2 ……………. yes<br /> Xinerama ……….. yes (loaded at runtime)<br /> Xrandr …………. yes (loaded at runtime)<br /> Xrender ………… yes<br /> XKB ……………. no<br /> XShape …………. yes<br /> XSync ………….. yes<br /> XVideo …………. yes<br /> Session management ….. yes<br /> SQL drivers:<br /> DB2 ……………… no<br /> InterBase ………… no<br /> MySQL ……………. yes (plugin)<br /> OCI ……………… no<br /> ODBC …………….. yes (plugin)<br /> PostgreSQL ……….. yes (plugin)<br /> SQLite 2 …………. yes (plugin)<br /> SQLite …………… yes (plugin, using bundled copy)<br /> TDS ……………… yes (plugin)<br /> udev ………………. yes<br /> xkbcommon ………….. yes (bundled copy)<br /> zlib ………………. yes (system library)
<br />NOTE: libxkbcommon 0.2.0 (or higher) not found on the system, will use<br />the bundled version from 3rd party directory.
<br />Qt is now configured for building. Just run 'make'.<br />Once everything is built, you must run 'make install'.<br />Qt will be installed into /usr/local/qt5
<br />Prior to reconfiguration, make sure you remove any leftovers from<br />the previous build.
Note, the compilation will take about two days to compile overclocked at 900 MHz. If you are logged in remotely consider using byobu or screen so that you can detach your session.
Then you need to run make as follows (check for errors in the output_make file):
make &> output_make<code>
<br />If that is good then run make install (check for errors in the output_make_install file):<br />
sudo make install &> output_make_install
After this you need to add some lines to your .bashrc file:
export LD_LIBRARY_PATH=/usr/local/qt5/lib/<br />export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/qt5/bin
You need to source your .bashrc file to set-up the above environment variables:
source~/.bashrc<code>
Then run this and check that it points to /usr/local/qt5/bin/qmake<br />
which qmake
Example output:
pi<code>raspberrypi ~/opt/qt5 $ which qmake<br />/usr/local/qt5/bin/qmake
After this you should be able to compile the sample applications and run them. Try the OpenGL Cube (I have not tested this in X windows, only from the console):
cp -r~/opt/qt5/qtbase/examples/opengl/cube ~/<br />cd~/cube<br />qmake<br />make<br />./cube