Qt on Raspberry pi3
-
Hi
If you get tired fighting cross compiling, there is also the option of using
http://www.qtrpi.com/home
its only Qt5.7 though so might not fit your use case. -
There's also the option to download Qt and QtCreator directly to the pi via the package manager.
The framework is limited to Qt 5.7, but as a quick entry to Qt on Pi its fine and the Pi3 is beefy enough to manage compiling projects itself. -
@Pablo-J.-Rogina
Did it miss a link ? -
@mrjj and @Pablo-J.-Rogina
I install every library that system required but when I cross compile Qt I got these errors:tforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmmain.cpp -o .moc/qeglfskmsgbmmain.moc
Makefile:2849: recipe for target '.obj/qeglfskmsgbmwindow.o' failed
make[7]: *** [.obj/qeglfskmsgbmwindow.o] Error 1
make[7]: *** Waiting for unfinished jobs....
make[7]: Leaving directory '/home/saman/qt-everywhere-src-5.11.0/buildfinal/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms'
Makefile:98: recipe for target 'sub-eglfs_kms-make_first' failed
make[6]: *** [sub-eglfs_kms-make_first] Error 2
make[6]: Leaving directory '/home/saman/qt-everywhere-src-5.11.0/buildfinal/qtbase/src/plugins/platforms/eglfs/deviceintegration'
Makefile:104: recipe for target 'sub-deviceintegration-make_first-ordered' failed
make[5]: *** [sub-deviceintegration-make_first-ordered] Error 2
make[5]: Leaving directory '/home/saman/qt-everywhere-src-5.11.0/buildfinal/qtbase/src/plugins/platforms/eglfs'
Makefile:125: recipe for target 'sub-eglfs-make_first' failed
make[4]: *** [sub-eglfs-make_first] Error 2
make[4]: *** Waiting for unfinished jobs....my configuration:
./configure -opengl es2 -ssl -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=/home/saman/QtonRaspb/tools-gcc-linaro-4.9/arm-bcm2708/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /media/saman/62ca0b6d-6291-4c40-b1fd-11bc291e4a381 -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -extprefix /home/saman/raspi/qt5pi -hostprefix /home/saman/raspi/qt5 -v -skip qtwayland -hostprefix /home/saman/raspberryPi3/Qt5.11.0My config summery:
Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: devices/linux-rasp-pi3-g++ (arm, CPU features: neon)
Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 concurrent dbus reduce_exports release_tools stl
Build options:
Mode ................................... release; optimized tools
Optimize release build for size ........ no
Building shared libraries .............. yes
Using C++ standard ..................... C++14
Using ccache ........................... no
Using gold linker ...................... no
Using new DTAGS ........................ yes
Using precompiled headers .............. yes
Using LTCG ............................. no
Target compiler supports:
NEON ................................. yes
Build parts ............................ libs
Qt modules and options:
Qt Concurrent .......................... yes
Qt D-Bus ............................... yes
Qt D-Bus directly linked to libdbus .... yes
Qt Gui ................................. yes
Qt Network ............................. yes
Qt Sql ................................. yes
Qt Testlib ............................. yes
Qt Widgets ............................. yes
Qt Xml ................................. yes
Support enabled for:
Using pkg-config ....................... yes
udev ................................... no
Using system zlib ...................... yes
Qt Core:
DoubleConversion ....................... yes
Using system DoubleConversion ........ yes
GLib ................................... yes
iconv .................................. no
ICU .................................... yes
Tracing backend ........................ <none>
Logging backends:
journald ............................. no
syslog ............................... no
slog2 ................................ no
Using system PCRE2 ..................... no
Qt Network:
getifaddrs() ........................... yes
IPv6 ifname ............................ yes
libproxy ............................... no
Linux AF_NETLINK ....................... yes
OpenSSL ................................ yes
Qt directly linked to OpenSSL ........ no
OpenSSL 1.1 ............................ no
SCTP ................................... no
Use system proxies ..................... yes
Qt Gui:
Accessibility .......................... yes
FreeType ............................... yes
Using system FreeType ................ yes
HarfBuzz ............................... yes
Using system HarfBuzz ................ no
Fontconfig ............................. yes
Image formats:
GIF .................................. yes
ICO .................................. yes
JPEG ................................. yes
Using system libjpeg ............... yes
PNG .................................. yes
Using system libpng ................ yes
EGL .................................... yes
OpenVG ................................. yes
OpenGL:
Desktop OpenGL ....................... no
OpenGL ES 2.0 ........................ yes
OpenGL ES 3.0 ........................ yes
OpenGL ES 3.1 ........................ yes
OpenGL ES 3.2 ........................ yes
Vulkan ................................. no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. yes
libinput ............................... no
INTEGRITY HID .......................... no
mtdev .................................. yes
tslib .................................. yes
xkbcommon-evdev ........................ yes
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ yes
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGL on X11 ........................... yes
LinuxFB ................................ yes
VNC .................................... yes
Mir client ............................. no
X11:
Using system-provided XCB libraries .. yes
EGL on X11 ........................... yes
Xinput2 .............................. yes
XCB XKB .............................. yes
XLib ................................. yes
XCB render ........................... yes
XCB GLX .............................. yes
XCB Xlib ............................. yes
Using system-provided xkbcommon ...... yes
Native painting (experimental) ....... yes
Qt Widgets:
GTK+ ................................... no
Styles ................................. Fusion Windows
Qt PrintSupport:
CUPS ................................... yes
Qt Sql:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. yes
SQLite2 ................................ yes
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... yes
Qt Testlib:
Tester for item models ................. yes
Qt SerialBus:
Socket CAN ............................. yes
Socket CAN FD .......................... yes
QtXmlPatterns:
XML schema support ..................... yes
Qt QML:
QML network support .................... yes
QML debugging and profiling support .... yes
QML delegate model ..................... yes
Qt Quick:
Direct3D 12 ............................ no
AnimatedImage item ..................... yes
Canvas item ............................ yes
Support for Qt Quick Designer .......... yes
Flipable item .......................... yes
GridView item .......................... yes
ListView item .......................... yes
Path support ........................... yes
PathView item .......................... yes
Positioner items ....................... yes
Repeater item .......................... yes
ShaderEffect item ...................... yes
Sprite item ............................ yes
Qt Gamepad:
SDL2 ................................... no
Qt 3D:
Assimp ................................. yes
System Assimp .......................... no
Output Qt3D Job traces ................. no
Output Qt3D GL traces .................. no
Use SSE2 instructions .................. no
Use AVX2 instructions .................. no
Aspects:
Render aspect ........................ yes
Input aspect ......................... yes
Logic aspect ......................... yes
Animation aspect ..................... yes
Extras aspect ........................ yes
Qt 3D Renderers:
OpenGL Renderer ........................ yes
Qt 3D GeometryLoaders:
Autodesk FBX ........................... no
Qt Bluetooth:
BlueZ .................................. yes
BlueZ Low Energy ....................... yes
Linux Crypto API ....................... yes
WinRT Bluetooth API (desktop & UWP) .... no
Qt Sensors:
sensorfw ............................... no
Qt Quick Controls 2:
Styles ................................. Default Fusion Imagine Material Universal
Qt Quick Templates 2:
Hover support .......................... yes
Multi-touch support .................... yes
Qt Multimedia:
ALSA ................................... yes
GStreamer 1.0 .......................... yes
GStreamer 0.10 ......................... no
Video for Linux ........................ yes
OpenAL ................................. no
PulseAudio ............................. yes
Resource Policy (libresourceqt5) ....... no
Windows Audio Services ................. no
DirectShow ............................. no
Windows Media Foundation ............... no
Qt WebEngine:
Embedded build ......................... yes
Pepper Plugins ......................... no
Printing and PDF ....................... no
Proprietary Codecs ..................... no
Spellchecker ........................... yes
Native Spellchecker .................... no
WebRTC ................................. no
Use System Ninja ....................... no
Geolocation ............................ no
Use v8 snapshot ........................ yes
Building v8 snapshot supported ......... no
Use ALSA ............................... yes
Use PulseAudio ......................... yes
Optional system libraries used:
re2 .................................. no
icu .................................. no
libwebp, libwebpmux and libwebpdemux . no
opus ................................. no
ffmpeg ............................... no
libvpx ............................... no
snappy ............................... no
libsrtp .............................. no
glib ................................. yes
zlib ................................. yes
minizip .............................. no
libevent ............................. no
jsoncpp .............................. yes
protobuf ............................. no
libxml2 and libxslt .................. no
lcms2 ................................ no
png .................................. no
JPEG ................................. no
harfbuzz ............................. no
Required system libraries:
fontconfig ........................... yes
dbus ................................. yes
nss .................................. yes
khr .................................. yes
glibc ................................ yes
Required system libraries for qpa-xcb:
libdrm ............................... yes
xcomposite ........................... yes
xcursor .............................. yes
xi ................................... yes
xrandr ............................... yes
xtst ................................. yesNote: Also available for Linux: linux-clang linux-icc
Note: -optimized-tools is not useful in -release mode.
Note: Dropped compiler flags '-pthread' when detecting library 'glib'.
Note: Dropped compiler flags '-pthread' when detecting library 'gstreamer'.
Note: Dropped compiler flags '-pthread' when detecting library 'gstreamer_app'.
Please help to Correct these errors...
-
@Saman19 said in Qt on Raspberry pi3:
tforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmmain.cpp -o .moc/qeglfskmsgbmmain.moc
Makefile:2849: recipe for target '.obj/qeglfskmsgbmwindow.o' failedThat's not the error message. Please look before it for the real cause of the compilation fail - and post it here.
EGLFS Raspberry Pi ................... no
You may want to check out
-device linux-rasp-pi3-g++-vc4
, it uses the GPU from on RPi. Note however, that your RPi sysroot needs to be up to date for Qt to find dependencies there. -
Well, compilation works for 5.10, 5.9 - they simply compile and work. With Qt 5.11.1, I've just tried and there seems to be a bug in QGeoMap.
If you want to try with 5.10:
You have to set up your toolchain and sysroot correctly, though. Follow the guide https://wiki.qt.io/RaspberryPi2EGLFS and you should be fine.Remember to get all the dependencies and to run the symlink fix afterwards. You may throw in some extra libs just to be sure:
sudo apt build-dep qt5-default qt5-qmake sudo apt install libiconv-hook-dev libinput-dev libts-dev bluez libbluetooth-dev libgstreamer1.0-dev libegl1-mesa # Optionally if it somehow still does not work: sudo apt install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libatspi2.0-dev libdbus-1-dev
And turn on OpenGL driver in
raspi-config
,Here is my compilation script, if it helps:
export QTVER=5101 wget https://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz tar -xaf qt-everywhere-src-5.10.1.tar.xz mv qt-everywhere-src-5.10.1 $QTVER-src cd $QTVER-build ../$QTVER-src/configure -release -opengl es2 -device linux-rasp-pi3-vc4-g++ \ -device-option CROSS_COMPILE=/path/to/toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot /path/to/sysroot \ -opensource -confirm-license -make libs -no-use-gold-linker \ -prefix /home/pi/qt/$QTVER -extprefix /path/to/qt-pi/$QTVER \ -hostprefix /path/to/$QTVER-qmake \ -skip qtserialbus -skip qtscxml -skip qtscript -skip qtcharts -skip qt3d \ -skip qtdatavis3d -skip qtcanvas3d -skip qtgamepad -skip qtvirtualkeyboard \ -skip qtwayland -skip qtwebengine -skip qtwebchannel -skip qtwebglplugin \ -skip qtwebsockets make -j 8 make install
-
@sierdzio
Thank you so much for the reply, I think i'm also seeing the issue with qgeomap when doing 'make install' for 5.11.0. I'm trying to build qgroundcontrol for the raspberry and apparently it needs 5.11.0.
Do you know a solution for the qgeomap bug? -
@chek said in Qt on Raspberry pi3:
@sierdzio
[...]
Do you know a solution for the qgeomap bug?Not yet, but I will check it out.
I don't see it reported on Qt bugtracker yet.
-
Hi, I've compiled 5.10.1 for the pi and it works, but when I try to open the qt-project qt-creator complains about my compiler: Unsuported Linux toolchain, only GCC 32- or 64-bit is supported.
I'm using "gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf"
Do you know what this could be? -
Have you added the linaro compiler in Qt Creator's settings?
-
Hm so it should work. Please check if the kit really points to your cross-compiled Qt. I've made a mistake of not checking that many times already :D And Qt Creator seems to auto-set the Qt version wrongly sometimes.
-
@sierdzio I successfully compile Qt 5.10.1 on my raspberry pi 3 using the device "linux-rasp-pi3-vc4-g++", however, after activating the OPENGL driver on raspi-cofnig, when running the qopenglwidget example, it shows the error "Failed to create service, already in use?", I checked on the internet and everybody suggest to disable the vc4 drivers to get rid of the error, however, if I do that the eglfs will complain that it cannot find any GBM, and indeed, I compile it to use those drivers, any idea how can I fix that?
-
Do you have X server running (Raspbian GUI) when you launch the example? If so, don't. Start the app directly from command line, without the X server. Not sure if it will help, but maybe.
I have not encountered that error myself.
-
@ronpetit said in Qt on Raspberry pi3:
@sierdzio I'm running it without X server, as I should
Now, I'm curious about this, what libs are you using for glesv2 and egl?, I'm using the ones in /opt/vc/lib folder, and I also cross compiled the Qt with those
Oh I don't remember to be honest. I think I didn't change anything from stock settings. I also didn't specify the OpenGL libs manually anywhere when building Qt or apps.