jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Cross-compilation guide for Qt 5.9.4 and RPi

Sun Feb 04, 2018 8:25 pm

G'day,

I've been attempting to setup a cross-compile workflow for the last week, and have not had any success, despite the numerous guides and how-to's online. My host machine is running 64-bit Ubuntu 16.04, my target is a Raspberry Pi 2 running Rasbian Lite.

I've tried each of the following guides numerous times, wiping and reinstalling both Ubuntu and Raspbian Lite each time:
In each example, I'm left with a sysroot folder or toolchain folder which is different to that in the tutorial, which ultimately prevents me from configuring a Device/Kit in Qt Creator.

Does anyone have a recent cross-compile guide, that they've managed to use successfully in the last couple of months? The above guides are all fairly old, and no matter how many attempts I make, I just cannot get it to work. I've been writing the steps I've taken as I've gone, so I fully intend to post an updated how-to guide once I've got it working, but I'm going to need some assistance to get there.

Thanks!

User avatar
mline
Posts: 1069
Joined: Sun Jan 27, 2013 1:47 pm
Location: Austria, Vienna

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Mon Feb 05, 2018 1:40 am

Here is my working step-by-step guide for Qt 5.7.1 with RPi Zero W based on https://wiki.qt.io/RaspberryPi2EGLFS

If "raspberrypi.local" dont work, use ip address instead.

Prepare Raspberry Pi

Please use a clean raspbian (2017-11-29, lite maybe works but not tested) image

Update
Edit sources list in /etc/apt/sources.list and uncomment the deb-src line

Code: Select all

sudo nano /etc/apt/sources.list

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
sudo reboot

Code: Select all

sudo rpi-update
sudo reboot
Install dependencies

Code: Select all

sudo apt-get build-dep qt4-x11
sudo apt-get build-dep libqt5gui5
sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0
If ready, dont shutdown your raspberry pi

Prepare Linux host (for example Ubuntu x64)

Update

Code: Select all

sudo apt-get update
sudo apt-get -y upgrade
Install dependencies

Code: Select all

sudo apt-get install git bison python gperf
Also install latest QtCreator (i use Qt 5.7.1 on Ubuntu 16.04 because later versions have problems with integrated menus)

Generate ssh public key

Code: Select all

ssh-keygen -t rsa -C pi@raspberrypi.local -N "" -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub | ssh -o StrictHostKeyChecking=no pi@raspberrypi.local "mkdir -p .ssh && chmod 700 .ssh && cat >> .ssh/authorized_keys"
Create folder

Code: Select all

sudo mkdir /opt/qt5pi
sudo chown 1000:1000 /opt/qt5pi
cd /opt/qt5pi
Or if you using multiple users on your system, replace 1000 with your username (uid/gid 1000 = default user/group)

Clone toolchain

Code: Select all

git clone https://github.com/raspberrypi/tools
Add toolchain binary directory to PATH. Open .bashrc and add line at end of file

Code: Select all

nano ~/.bashrc

Code: Select all

export PATH=$PATH:/opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
To activate this changes, you have to restart the terminal.
If you use a 32Bit host, use this toolchain path: /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin

Get Qt sources

Code: Select all

wget https://download.qt.io/official_releases/qt/5.7/5.7.1/single/qt-everywhere-opensource-src-5.7.1.tar.xz
It should also work for higher versions

Untar Qt sources

Code: Select all

tar xf qt-everywhere-opensource-src-5.7.1.tar.xz
Create hf configuration

Code: Select all

cp -R qt-everywhere-opensource-src-5.7.1/qtbase/mkspecs/linux-arm-gnueabi-g++ qt-everywhere-opensource-src-5.7.1/qtbase/mkspecs/linux-arm-gnueabihf-g++
sed -i -e 's/arm-linux-gnueabi-/arm-linux-gnueabihf-/g' qt-everywhere-opensource-src-5.7.1/qtbase/mkspecs/linux-arm-gnueabihf-g++/qmake.conf
Get raspberry pi sysroot

Code: Select all

mkdir sysroot sysroot/usr sysroot/opt
rsync -avz pi@raspberrypi.local:/lib sysroot
rsync -avz pi@raspberrypi.local:/usr/include sysroot/usr
rsync -avz pi@raspberrypi.local:/usr/lib sysroot/usr
rsync -avz pi@raspberrypi.local:/opt/vc sysroot/opt
This will take a while

Create correct symlinks to "missing" libraries

Code: Select all

mv sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0_backup
ln -s sysroot/opt/vc/lib/libEGL.so sysroot/usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0

Code: Select all

mv sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0_backup
ln -s sysroot/opt/vc/lib/libGLESv2.so sysroot/usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0

Code: Select all

ln -s sysroot/opt/vc/lib/libEGL.so sysroot/opt/vc/lib/libEGL.so.1

Code: Select all

ln -s sysroot/opt/vc/lib/libGLESv2.so sysroot/opt/vc/lib/libGLESv2.so.2
Convert absolute symlinks into relative symlinks

Code: Select all

wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
chmod +x sysroot-relativelinks.py
sysroot-relativelinks.py sysroot
Create build dir

Code: Select all

mkdir qt5build
Configure

Code: Select all

cd qt5build
../qt-everywhere-opensource-src-5.7.1/configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf- -sysroot /opt/qt5pi/sysroot -prefix /usr/local/qt5pi -opensource -confirm-license -skip qtwebengine -skip qtscript -nomake examples -make libs -v
Sadly QtWebengine dont compile on Raspberry Pi 1 (maybe also Pi 2), so we have to skip it. Also skip QtScript, its deprecated.

For every version of Raspberry Pi, you have to change -device
Raspberry Pi 1 (+ Zero and Zero W): -device linux-rasp-pi-g++
Raspberry Pi 2: -device linux-rasp-pi2-g++
Raspberry Pi 3: -device linux-rpi3-g++
Raspberry Pi 3 with VC4 driver: -device linux-rpi3-vc4-g++

Make

Code: Select all

make
make install
Upload to raspberry pi

Code: Select all

cd /opt/qt5pi
rsync -avz sysroot/usr/local/qt5pi pi@raspberrypi.local:/usr/local
Qt configuration

Open QtCreator

Tools->Options...->Devices->Add
Generic Linux Device
Edit Hostname, authentication type key, username and add private key ( ~/.ssh/id_rsa )

Tools->Build&Run->Debuggers->Add
Edit name and path ( /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gdb )

Tools->Compilers->Add->GCC->C
Edit name and path ( /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc )

Tools->Compilers->Add->GCC->C++
Edit name and path ( /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ )

Tools->Qt Versions->Add
Choose /opt/qt5pi/sysroot/usr/local/qt5pi/bin/qmake

Tools->Kits->Add
Edit name
Device type: Generic Linux Device
Device: Choose prior created raspberry pi device
Sysroot: Choose /opt/qt5pi/sysroot
C and C++: Choose prior created raspberry pi compilers
Debugger: Choose prior created raspberry pi debugger
Qt version: Choose prior created raspberry pi qt version

Ready :)

*edit
If you press compile Button inside QtCreator, source will just compile.
If you press the green Play button, source will compile, upload binary with sftp and executed on your Raspberry Pi.
Debug button should also work

*edit2
Typo
Last edited by mline on Wed Feb 07, 2018 10:28 am, edited 2 times in total.
<~~>

jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Mon Feb 05, 2018 2:20 am

Brilliant mate, thank you so much! I'll give this a go as soon as I can and report back.

jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Feb 06, 2018 12:06 am

To confirm, the following package and dependencies aren't required for a Qt5 build?

Code: Select all

sudo apt-get build-dep qt4-x11

User avatar
mline
Posts: 1069
Joined: Sun Jan 27, 2013 1:47 pm
Location: Austria, Vienna

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Feb 06, 2018 12:53 am

Confirmed :)

*edit
Oh no, i readed it wrong... you need this! This command is required.
Also take a look at #5 https://wiki.qt.io/RaspberryPi2EGLFS#Step_by_step
If you dont install it, some dependencies are missing
<~~>

jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Feb 06, 2018 6:28 am

That's actually what threw me! I had seen that step previously, but on further inspection of the package itself, I couldn't understand why it was included in a Qt5 build. I suspect that some Qt4-era packages are still used under Qt5. I'll include it regardless. Thanks again!

User avatar
mline
Posts: 1069
Joined: Sun Jan 27, 2013 1:47 pm
Location: Austria, Vienna

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Feb 06, 2018 6:45 am

Code: Select all

pi@raspberrypi:~ $ sudo apt-get build-dep qt5-x11
Reading package lists... Done
E: Unable to find a source package for qt5-x11
pi@raspberrypi:~ $ 
Thats why you need qt4-x11
Maybe it also works with qt5-default but... never change a running system :D
<~~>

jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Feb 06, 2018 8:59 am

I'm not sure how many more attempts at this I'm going to make, I just don't seem to have the same experience as others when it comes to files, directories, dependencies, etc.

Code: Select all

make[3]: Leaving directory '/opt/qt5pi/qt5build/qtbase/src/tools/bootstrap'
make[2]: Leaving directory '/opt/qt5pi/qt5build/qtbase/src'
Makefile:48: recipe for target 'sub-src-make_first' failed
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory '/opt/qt5pi/qt5build/qtbase'
Makefile:72: recipe for target 'module-qtbase-make_first' failed
make: *** [module-qtbase-make_first] Error 2
I've just followed your process step by step, and despite a seemingly successful ./configure, I receive the following error immediately after running 'make'.

User avatar
mline
Posts: 1069
Joined: Sun Jan 27, 2013 1:47 pm
Location: Austria, Vienna

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Feb 06, 2018 9:19 am

Code: Select all

make: *** [module-qtbase-make_first] Error 2
There is another error... please also post lines of Error 1
<~~>

jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Feb 06, 2018 7:59 pm

My apologies for missing the first error. I went to re-run the make command to get both errors, and it seems to have worked successfully? The only thing I did differently this time was omitting the '-jX' parameter, where X is the number of CPU threads. I've got a 12-core machine, so had used '-j24' previously; perhaps this was causing an issue?

I ran the 'make install' command as I was walking out the house this morning, so hopefully it will have finished successfully when I get home.

User avatar
mline
Posts: 1069
Joined: Sun Jan 27, 2013 1:47 pm
Location: Austria, Vienna

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Feb 06, 2018 8:25 pm

jars121 wrote:
Tue Feb 06, 2018 7:59 pm
...previously; perhaps this was causing an issue?
Yes ;)
It seems, some of the Qt sources depends on previously compiled sources
jars121 wrote:
Tue Feb 06, 2018 7:59 pm
I ran the 'make install' command as I was walking out the house this morning, so hopefully it will have finished successfully when I get home.
I am pretty sure it will be finished.

What Qt version did you choose? 5.7.1, 5.9.4 or another one?
<~~>

jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Feb 06, 2018 10:22 pm

I had my girlfriend send through a pic of the terminal, and it looks like it did finish up successfully, so I'll move onto the Qt Creator setup this afternoon.

I ended up going with 5.9.4; I'm not tied to this particular version, so will experiment with others in due course. I've been writing my software with 5.10, but haven't been using any components which aren't included in the earlier 5.9 versions.

jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Wed Feb 07, 2018 9:23 am

I feel like I'm really close now.

I believe I've configured Qt Creator correctly (per your instruction), but I'm unable to build a Qt example project using the Raspberry Pi kit.

I'm receiving the "sys/cdefs.h: No such file or directory" error, which from a google search, appears to be due to compiling a 32-bit program using a 64-bit system. I've installed all the required packages to allow for 32-bit compilation on a 64-bit system, but it hasn't made any difference.

One thing to note is that under 'Build and Run' and 'Kits', my Raspberry Pi kit shows an error:

Code: Select all

The compiler "GCC (c++ Raspberry Pi 2)" (x86-linux-generic-elf-64bit) cannot produce code for the Qt version "Qt 5.9.4 (qt5pi)" (arm-linux-generic-elf-32bit).
Any thoughts?

User avatar
mline
Posts: 1069
Joined: Sun Jan 27, 2013 1:47 pm
Location: Austria, Vienna

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Wed Feb 07, 2018 10:10 am

You set the wrong compilers (C and/or C++) for the Raspberry Pi Kit.

The compiler "GCC (c++ Raspberry Pi 2)" (x86-linux-generic-elf-64bit) cannot produce code for the Qt version "Qt 5.9.4 (qt5pi)" (arm-linux-generic-elf-32bit).

Currently you use x86 GCC: x86-linux-generic-elf-64bit
But you should use the toolchain GCC: arm-linux-generic-elf-32bit
Tools->Compilers->Add->GCC->C
Edit name and path ( /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc )

Tools->Compilers->Add->GCC->C++
Edit name and path ( /opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ )

...

C and C++: Choose prior created raspberry pi compilers
jars121 wrote:
Wed Feb 07, 2018 9:23 am
I've installed all the required packages to allow for 32-bit compilation on a 64-bit system, but it hasn't made any difference.
You dont have to install any other packages (except git, bison, python and gperf) on your host system. The toolchain gcc-linaro-arm-linux-gnueabihf-raspbian-x64 is for 32Bit ARM (arm-linux-generic-elf-32bit). x64 means, the host is 64Bit. All libraries, needed from this toolchain are in the toolchain-folder. All other needed libraries are in the sysroot folder, you downloaded from Raspberry Pi. No host-system libraries should be used.
You should undo your changes (be carefull. dont break dependencies on your host system ;) )
<~~>

jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Wed Feb 07, 2018 10:51 am

It's working now :D

Thank you so much for all your help!

I had selected the correct C and C++ compiler paths, but for some reason the ABI was set to custom, and was referencing the x86 compiler, as shown in the error. I re-selected the C and C++ compiler paths, and set the ABI to the generic arm-linux option and everything compiles and runs on the RPi perfectly.

Thank you!

G4NTZ
Posts: 2
Joined: Mon Feb 19, 2018 12:31 am

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Mon Feb 19, 2018 2:38 am

Hello,
Thank you for this great guide. I am trying to get Qt 5.10.1 and I have a problem;

Code: Select all

Command line: -opengl es2 -device linux-rasp-pi3-vc4-g++ -device-option CROSS_COMPILE=arm-linux-gnueabihf- -sysroot /opt/qt5pi/sysroot -prefix /usr/local/qt5pi -opensource -confirm-license -skip qtwebengine -skip qtscript -nomake examples -no-use-gold-linker -make libs -v
executing config test architecture
+ cd /home/pi/qt5build/config.tests/arch && /home/pi/qt5build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/opt/qt5pi/sysroot" "QMAKE_CXXFLAGS += --sysroot=/opt/qt5pi/sysroot" "QMAKE_LFLAGS += --sysroot=/opt/qt5pi/sysroot" -early "CONFIG += cross_compile" /home/pi/ qt-everywhere-src-5.10.1/qtbase/config.tests/arch
+ cd /home/pi/qt5build/config.tests/arch && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
> rm -f arch.o
> rm -f *~ core *.core
> arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/opt/qt5pi/sysroot -O2 -w -fPIC  -I/home/pi/ qt-everywhere-src-5.10.1/qtbase/config.tests/arch -I. -I/home/pi/ qt-everywhere-src-5.10.1/qtbase/mkspecs/devices/linux-rasp-pi3-vc4-g++ -o arch.o /home/pi/ qt-everywhere-src-5.10.1/qtbase/config.tests/arch/arch.cpp
> /home/pi/ qt-everywhere-src-5.10.1/qtbase/config.tests/arch/arch.cpp:43:19: fatal error: stdio.h: No such file or directory
>  #include <stdio.h>
>                    ^
> compilation terminated.
> Makefile:179: recipe for target 'arch.o' failed
> make: *** [arch.o] Error 1

I checked the /usr/include file and it is there. When I add it inside the /home/pi/ qt-everywhere-src-5.10.1/qtbase/config.tests/arch/ location then it asks me another include file.
I don't know which step I did wrong. Should I try 5.7.1 instead of 5.10.1 or can I fix this?
Thanks.

User avatar
mline
Posts: 1069
Joined: Sun Jan 27, 2013 1:47 pm
Location: Austria, Vienna

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Mon Feb 19, 2018 10:24 am

Maybe your sysroot directory is wrong. Is it at /opt/qt5pi/sysroot ?
Also be sure you added toolchain path to your hosts env PATH

You dont need to use 5.7.1 but, if you do all steps (exact) of my tutorial, it should work fine.
<~~>

G4NTZ
Posts: 2
Joined: Mon Feb 19, 2018 12:31 am

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Mon Feb 19, 2018 12:51 pm

mline wrote:
Mon Feb 19, 2018 10:24 am
Maybe your sysroot directory is wrong. Is it at /opt/qt5pi/sysroot ?
Also be sure you added toolchain path to your hosts env PATH

You dont need to use 5.7.1 but, if you do all steps (exact) of my tutorial, it should work fine.
Hi thanks for quick respond. Like you said it isn't there. I will start from beginning.

Edit 1 :

I think I found what I did wrong;
Create folder
Code: Select all

sudo mkdir /opt/qt5pi
sudo chown 1000:1000 /opt/qt5pi
cd /opt/qt5pi
Or if you using multiple users on your system, replace 1000 with your username (uid/gid 1000 = default user/group)

Clone toolchain
Code: Select all

git clone https://github.com/raspberrypi/tools
Add toolchain binary directory to PATH. Open .bashrc and add line at end of file
Code: Select all

nano ~/.bashrc
Code: Select all

export PATH=$PATH:/opt/qt5pi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
To activate this changes, you have to restart the terminal.
After the restart I have to return opt/qt5pi directory again right? Then I should start sysroot step?


Edit:2


Yes it compiled now. I should have returned the opt/qt5pi directory. I have another question

Code: Select all

EGLFS Raspberry Pi ................... no
I think it should be yes right ?

Here is the output:

Code: Select all

Building on: linux-g++ (arm, CPU features: <none>)
Building for: devices/linux-rasp-pi3-g++ (arm, CPU features: neon)
Configuration: cross_compile use_gold_linker compile_examples enable_new_dtags largefile neon precompile_header shared rpath release c++11 c++14 c++1z concurrent dbus reduce_exports stl
Build options:
  Mode ................................... release
  Optimize release build for size ........ no
  Building shared libraries .............. yes
  Using C++ standard ..................... C++1z
  Using ccache ........................... no
  Using gold linker ...................... yes
  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
  QML debugging .......................... yes
  udev ................................... yes
  Using system zlib ...................... yes
Qt Core:
  DoubleConversion ....................... yes
    Using system DoubleConversion ........ yes
  GLib ................................... yes
  iconv .................................. no
  ICU .................................... yes
  Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
  Using system PCRE2 ..................... no
Qt Network:
  getifaddrs() ........................... yes
  IPv6 ifname ............................ yes
  libproxy ............................... no
  OpenSSL ................................ yes
    Qt directly linked to OpenSSL ........ no
  SCTP ................................... no
  Use system proxies ..................... yes
Qt Gui:
  Accessibility .......................... yes
  FreeType ............................... yes
    Using system FreeType ................ yes
  HarfBuzz ............................... yes
    Using system HarfBuzz ................ yes
  Fontconfig ............................. yes
  Image formats:
    GIF .................................. yes
    ICO .................................. yes
    JPEG ................................. yes
      Using system libjpeg ............... yes
    PNG .................................. yes
      Using system libpng ................ yes
  EGL .................................... yes
  OpenVG ................................. no
  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 ............................... yes
  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 ...................... no
    EGLFS GBM ............................ yes
    EGLFS Mali ........................... no
    EGLFS Raspberry Pi ................... no
    EGL on X11 ........................... no
  LinuxFB ................................ yes
  VNC .................................... yes
  Mir client ............................. no
  X11:
    Using system-provided XCB libraries .. yes
    EGL on X11 ........................... no
    Xinput2 .............................. yes
    XCB XKB .............................. yes
    XLib ................................. yes
    XCB render ........................... yes
    XCB GLX .............................. yes
    XCB Xlib ............................. yes
    Using system-provided xkbcommon ...... no
    Native painting (experimental) ....... yes
Qt Widgets:
  GTK+ ................................... no
  Styles ................................. Fusion Windows
Qt PrintSupport:
  CUPS ................................... yes
Qt Sql:
  DB2 (IBM) .............................. no
  InterBase .............................. no
  MySql .................................. yes
  OCI (Oracle) ........................... no
  ODBC ................................... yes
  PostgreSQL ............................. yes
  SQLite2 ................................ yes
  SQLite ................................. yes
    Using system provided SQLite ......... no
  TDS (Sybase) ........................... yes
Qt SerialBus:
  Socket CAN ............................. yes
  Socket CAN FD .......................... yes
QtXmlPatterns:
  XML schema support ..................... yes
Qt QML:
  QML interpreter ........................ yes
  QML network support .................... 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
  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 GeometryLoaders:
  Autodesk FBX ........................... no
Qt Wayland Drivers:
  EGL .................................... yes
  Raspberry Pi ........................... no
  XComposite EGL ......................... no
  XComposite GLX ......................... no
  DRM EGL ................................ no
  libhybris EGL .......................... no
Qt Wayland Client ........................ yes
Qt Wayland Compositor .................... yes
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 Positioning:
  Gypsy GPS Daemon ....................... no
  WinRT Geolocation API .................. no
Qt Location:
  Geoservice plugins:
    OpenStreetMap ........................ yes
    HERE ................................. yes
    Esri ................................. yes
    Mapbox ............................... yes
    MapboxGL ............................. yes
    Itemsoverlay ......................... 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

Note: Also available for Linux: linux-clang linux-icc

Note: PKG_CONFIG_LIBDIR automatically set to /opt/qt5pi/sysroot/usr/lib/pkgconfig:/opt/qt5pi/sysroot/usr/share/pkgconfig:/opt/qt5pi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig

Note: PKG_CONFIG_SYSROOT_DIR automatically set to /opt/qt5pi/sysroot

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'.

jars121
Posts: 123
Joined: Tue Jun 25, 2013 8:35 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Wed Feb 21, 2018 1:18 am

That should be yes...

What make parameters did you use?

bastisawesome
Posts: 4
Joined: Tue Mar 27, 2018 11:29 am

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Mar 27, 2018 11:32 am

I'm not sure how everyone else went about this, but when running rsync to my Pi's /usr/local I got a lot of permission errors and nothing went through. My solution was to change the ownership of the directory to the Pi user long enough to run rsync. I'm sure there's a better way to do this, but I don't know what it is.

bastisawesome
Posts: 4
Joined: Tue Mar 27, 2018 11:29 am

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Mar 27, 2018 12:18 pm

Okay, ran a test program and got an error here: error: undefined reference to `__cxa_throw_bad_array_new_length@CXXABI_1.3.8'.
My quick Google search has told me it's an issue with ICU, and I'm completely lost as to where to go from here.

User avatar
mline
Posts: 1069
Joined: Sun Jan 27, 2013 1:47 pm
Location: Austria, Vienna

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Mar 27, 2018 5:04 pm

What version of Pi do you use?
What version of raspbian do you use?
<~~>

Volodymyr
Posts: 1
Joined: Tue Mar 27, 2018 6:15 pm

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Mar 27, 2018 6:27 pm

Already tried several times and always the same error occurs

adminpri@rpi3:/opt/qt5pi$ ls
qt5build sysroot tools
qt-everywhere-opensource-src-5.7.1 sysroot-relativelinks.py
adminpri@rpi3:/opt/qt5pi$ sysroot-relativelinks.py sysroot
bash: /usr/bin/python: No such file or directory
adminpri@rpi3:/opt/qt5pi$

Ubuntu version
Linux rpi3 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 15:31:16 UTC 2013 i686 i686 i386 GNU/Linux

Raspberry version
Linux raspberrypi 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l GNU/Linux

bastisawesome
Posts: 4
Joined: Tue Mar 27, 2018 11:29 am

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Tue Mar 27, 2018 6:52 pm

mline wrote:
Tue Mar 27, 2018 5:04 pm
What version of Pi do you use?
What version of raspbian do you use?
Pi Zero W running Raspbian Stretch. I finally got everything working, with a bit of struggle, except now even the basic MainWindow project segfaults on the Pi. What's odd about this is that about an hour before this happened I had it running perfectly fine. I haven't changed anything on the Pi and I don't think I've messed with the host machine.

bastisawesome
Posts: 4
Joined: Tue Mar 27, 2018 11:29 am

Re: Cross-compilation guide for Qt 5.9.4 and RPi

Wed Mar 28, 2018 2:10 am

Alright, once again an entire day wasted trying to get Qt to do what I want it to and still it doesn't work correctly. I need it to run as XCB natively, not as ELGFS, so my latest build attempt I configured it with -no-elgfs and -xcb, but still it wants to run as ELGFS. I'm starting to really hate Qt for the RPi, but it's still the only GUI library I actually know how to use with any level of efficiency.

Return to “Graphics programming”

Who is online

Users browsing this forum: No registered users and 1 guest