Javier Bonilla

Researcher at CIEMAT - PSA
PhD. in Computer Science / Solar Thermal Energy Researcher
Javier Bonilla

Helpful? spread the word!

Qt 5.12 is a long-term support (LTS) release of the popular Qt framework. If you are not familiar with it, Qt is a rich framework with plenty of ready-to-use multi-platform components for diverse areas such as multimedia, network, connectivity, graphics, and much more.

In this tutorial, you will learn how to cross-compile Qt 5.12 for Raspberry Pi in your computer and install it in your Raspberry. This will allow you to design and build your Raspberry Pi apps in your computer thanks to Qt Creator and, execute and debug them directly in your Raspberry Pi. Qt creator is a powerful multi-platform Integrated Development Environment (IDE) to create and deploy your Qt apps and it is available for Linux, macOS and Windows.

Article updates

  10 May, 2019    Tested & updated for Qt 5.12.3  
  23 January, 2019    First version for Qt 5.12, later tested & updated for Qt 5.12.2  

Hardware

This tutorial considers Raspberry Pi 3 model B+ and Qt 5.12, however these instructions should be similar for new Qt releases, as well as other Raspberry Pi board versions. The desktop Operating System (OS) is Linux (openSUSE Tumbleweed) and the Raspberry Pi OS is Raspbian strech. Again, the tutorial steps should be quite similar in other configurations.

Raspberry PI 3 Model B+
Raspberry Pi Zero WH (WiFi and pre-soldered header)

These are affiliate links. This means if you click on the link and purchase the promoted item, we will receive a small affiliate commission at no extra cost to you, the price of the product is the same. We would really appreciate your support to our work and website if this is fine for you.

Note: this tutorial works for Qt 5.12 and 5.12.2, 5.12.3 (it doesn’t for 5.12.1 due to some bugs). For Qt 5.12.2 and 5.12.3, the build configuration file must be set to linux-rasp-pi-g++ instead of linux-rasp-pi3-g++ in the -device argument. This is also mentioned below in the step 6. Stay tuned for updates about new versions. Also, have a look at the comments below for new findings.

It is assumed that you have a SD card with Raspbian strech installed in your Raspberry Pi, otherwise download it and follow the installation guide. Also, check that you have the latest firmware, or install it and reboot the system. Execute the following command in the Raspberry Pi command-line interface for updating the firmware.

sudo rpi-update
reboot

Make sure that you have activated the Secure Shell (SSH) protocol in Raspbian. We will need it later to comunicate Qt Creator with your Raspbery Pi.

 sudo raspi-config

Select Interfacing Options, select ssh, choose yes and finish.

raspi-config

The following list summarizes the main steps to cross-compile Qt 5.12 for Raspberry Pi, we will be describing each of them in this post. The [Pi] label means this action is done in the Raspberry Pi, whereas [Co] means it has to be performed in you computer.

  1. Install development libraries – [Pi]
  2. Prepare target folder – [Pi]
  3. Create working folder and set a toolchain – [Co]
  4. Create and configure a sysroot – [Co]
  5. Download Qt – [Co]
  6. Configure Qt for cross compilation – [Co]
  7. Compile, install and deploy Qt – [Co]
  8. Setup Qt Creator for Raspberry Pi cross compilation – [Co]

1. Install development libraries – [Pi]

We need to install some development libraries, so the first thing to do is to allow the system to install source packages, for this you only have to uncomment the deb-src line in the /etc/apt/sources.list file, which configures the system repositories. Use your favorite text editor for this, we are using nano in this example.

sudo nano /etc/apt/sources.list

The next step is to update and install the required development packages.

sudo apt-get update
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

2. Prepare target folder – [Pi]

This step just involves creating a folder in our Raspberry Pi for the pi user. This folder (/usr/local/qt5pi) will be used to deploy Qt from our computer to the Raspberry Pi.

sudo mkdir /usr/local/qt5pi
sudo chown pi:pi /usr/local/qt5pi

3. Create working folder and set a toolchain – [Co]

Create a working folder in your computer and download the toolchain.

mkdir ~/raspi
cd ~/raspi
git clone https://github.com/raspberrypi/tools

4. Create and configure a sysroot – [Co]

A sysroot is a directory structure that includes all the folders needed to run a particular system. We are creating here a sysroot for Raspberry Pi cross compilation in our computer.

mkdir sysroot sysroot/usr sysroot/opt

We can use rsync to synchronize our computer sysroot and the Raspberry Pi. So, if we make changes in our computer sysroot, they can be easily transferred to our Raspberry Pi; raspberrypi_ip is the network interface name or IP address of your Raspberry Pi.

rsync -avz pi@raspberrypi_ip:/lib sysroot
rsync -avz pi@raspberrypi_ip:/usr/include sysroot/usr
rsync -avz pi@raspberrypi_ip:/usr/lib sysroot/usr
rsync -avz pi@raspberrypi_ip:/opt/vc sysroot/opt

Next, we need to adjust our symbolic links in sysroot to be relative since this folder structure is in both our computer and Raspberry Pi.

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

5. Download Qt – [Co]

Download and untar Qt 5.12.3 or any other version you want to use.

wget http://download.qt.io/official_releases/qt/5.12/5.12.3/single/ qt-everywhere-src-5.12.3.tar.xz
tar xvf  qt-everywhere-src-5.12.3.tar.xz
cd  qt-everywhere-src-5.12.3

6. Configure Qt for cross compilation – [Co]

Note: In new Raspbian stretch versions, EGL libraries have different names than those assumed in Qt configuration files, so edit the ./qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf file and substitute all references to -lEGL and -LGLESv2 for -lbrcmEGL and -lbrcmGLESv2, respectively.

The linux-rasp-pi3-g++ (Qt 5.12) or linux-rasp-pi-g++ (Qt 5.12.2 and Qt 5.12.3) folder applies to Raspberry Pi 3 version, if you have a different board version check the list of compatible devices which can be found in ./qtbase/mkspecs/devices and in the table below (summarized from the table in the tutorial to build Qt 5.12 for debian strech directly on Raspberry Pi).

VersionConfigure optionArchitectureRemarks
  Raspberry Pi 3
  (not working for
  Qt 5.12.2 & 5.12.3)
-platform linux-rpi3-g++ARM V8QtScript build fails
-skip qtscript needed
  Raspberry Pi 2-platform linux-rpi2-g++ARM V7
  Raspberry Pi 1
  Raspberry Pi Zero
-platform linux-rpi-g++ARM V6

An alternative way to fix the issue with the EGL libraries (copying and moving them) is given at Qt Wiki – RaspberryPi2EGLFS – step 14.

The following command configure the open-source Qt version for cross compilation. Again, the particular device is set by the -device argument in this case linux-rasp-pi-g++, set the appropriate value for your board version. You can omit the compilation of problematic or time consuming modules using the -skip argument. In this case, we have omitted the compilation of the qtwayland, qtlocation and qtscript modules.

Note: For Qt 5.12.2 and 5.12.3, the build configuration file must be set to linux-rasp-pi-g++ instead of linux-rasp-pi3-g++ in the -device argument.

./configure -release -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm

For a successful configuration, verify that the build options includes EGFLS for Raspberry Pi.

Build options:
......
QPA backends:
  ......
  EGLFS .................................. yes
  EGLFS details:
    ......
    EGLFS Raspberry Pi ................... yes
    ......

7. Compile, install and deploy Qt – [Co]

The exact compilation time depends on your computer performance. This process can take up to 2 or 3 hours in nowadays common computers. Compiler processes can be executed in parallel by means of the j flag. For four make processes, execute: make -j 4.

make
make install

Note: You may face some errors during the compilation the Qt 5.12 process due to some bugs. They have been already patched in Qt 5.12.1, but this tutorial currently doesn’t work for this version. You may prefer to compile the newest Qt 5.12.2 or Qt 5.12.3 versions to avoid these bugs.

The procedure to fix these bugs for Qt 5.12 consists in downloading Qt 5.12.1 and overwriting the same files in your Qt 5.12.0 source folder. You can find a list of the bugs you may face below together with the files you need to update.

qendianQTBUG-71945

  • qtbase/src/corelib/global/qendian.cpp
  • qtbase/src/corelib/global/qendian.h

qquicktableviewQTBUG-71998

  • qtdeclarative/src/quick/items/qquicktableview.cpp

qconnectionfactoriesQTBUG-72991

  • qtremoteobjects/src/remoteobjects/qconnectionfactories.cpp

qquickcontrolQTBUG-73308

  • qtquickcontrols2/src/quicktemplates2/qquickcontrol.cpp

qvirtualkeyboardselectionlistmodel – Qt bug?

  • qtvirtualkeyboard/src/virtualkeyboard/qvirtualkeyboardselectionlistmodel.cpp

Once Qt is compiled, it can be deployed to your Raspberry Pi using the rsync command.

rsync -avz qt5pi pi@raspberrypi_ip:/usr/local

8. Setup Qt Creator for Raspberry Pi cross compilation – [Co]

If you do not have installed Qt Creator, follow the instructions in the Qt download page to download and install it. Then, follow these instructions to configure cross-compilation support.

First, open Qt Creator, go to the Tools -> Options menu, select the Devices section and Devices tab. Add a new Generic Linux Device.

Qt Creator

Set a name for the configuration (Raspberry Pi), the network name or IP, the username (pi) and password (by default raspberry).

Qt Creator

Before you finish the wizard, the connection to your Raspberry Pi will be verified and you will have then a new device configured in Qt Creator.

Qt Creator

Next, go to the Kits section and Compilers tab, Add GCC C and C++ cross compilers for Raspberry Pi.

The path for the GCC C Raspberry Pi compiler is ~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/bin/gcc.

Qt Creator

The path for the GCC C++ Raspberry Pi compiler is the same as for the GCC C compiler.

Qt Creator

Next, go to the Debuggers tab, and Add a debugger, set its path to ~/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-gdb.

Qt Creator

Go to the Qt Versions tab and Add a new version: Qt 5.12 (Raspberry Pi), set the qmake path to ~/raspi/qt5/bin/qmake.

Qt Creator

Finally, go to the Kits tab, Add a new kit, set the name and icon you prefer, and pay attention to the following configuration:

  • Device type: Generic Linux Device
  • Device: Raspberry Pi (defaut for Generic Linux)
  • Sysroot: ~/raspi/sysroot
  • Compiler C: GCC (Raspberry Pi)
  • Compiler C++: GCC (Raspberry Pi)
  • Debugger: GDB (Raspberry Pi)
  • Qt version: Qt 5.12 (Raspberry Pi)
Qt Creator

All the configuration is already done. You can test your configuration by creating anew project and selecting the previously defined kit configuration: Raspberry Pi.

Qt Creator

Congratulations! You can now design, build and deploy your Qt Raspberry Pi apps in you computer and, execute and debug them directly in your Raspberry Pi.

Qt Creator
Cross-compile and deploy Qt 5.12 for Raspberry Pi
4.4 (88%) 5 vote[s]

213
Leave a Reply

avatar
2000
41 Comment threads
172 Thread replies
11 Followers
 
Most reacted comment
Hottest comment thread
44 Comment authors
PascalMewsterMoritz MSincereJohn Woltman Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Alex GTECH
Member

Hi ,thanks for the excellent article!
I got the error with “make” command. Any thoughts on approach?

make[3]: arm-linux-gnueabihf-g++: Command not found
Makefile:11829: recipe for target ‘.obj/qendian.o’ failed
make[3]: *** [.obj/qendian.o] Error 127
make[3]: Leaving directory ‘/home/pi/raspi/qt-everywhere-src-5.12.0/qtbase/src/corelib’

Jpp
Guest
Jpp

Same error on make command. Did you find any solution ? @alex

Alex GTECH
Member

I used the latest toolchain 7.4.1. (gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf)
https://releases.linaro.org/components/toolchain/binaries/latest-7/

It work for 5.12.0.

Foufy
Guest
Foufy

Thank you!
This configuration works also for me.
But I can’t configure QtCreator. Which GCC did you put for the c++ compiler? Because there are no GCC in gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/bin/ !

Alex GTECH
Member

The c++ compiler should be specify to {your 7.4.1 toolchain’s folder}/bin/arm-linux-gnueabihf-g++

In my case, I copy and replace the 7.4.1 file to origin toolchain’s folder (arm-rpi-4.9.3-linux-gnueabihf).

So my c++ compile folder is
/home/alex/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/

The QtCreator c++ path to:
/home/alex/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++

Harikrishnan P
Guest
Harikrishnan P

Thank you very much Javier Bonilla… You saved me a lot of time…. Its cool to see my Qt Qml application running in Raspberry Pi 3B+……

Preh Android
Member

Hello,

I tried your method and the a bit of the steps here: http://www.tal.org/tutorials/building-qt-512-raspberry-pi

I get the following error
home/pi/qt-everywhere-src-5.12.0/qtbase/mkspecs/linux-g++ -o verifyspec.o /home/pi/qt-everywhere-src-5.12.0/qtbase/config.tests/verifyspec/verifyspec.cpp

g++ -Wl,-O1 -fuse-ld=gold -o verifyspec verifyspec.o
/usr/bin/ld.gold: error: verifyspec.o: unknown CPU architecture
collect2: error: ld returned 1 exit status
Makefile:66: recipe for target ‘verifyspec’ failed
make: *** [verifyspec] Error 1
Note: Also available for Linux: linux-clang linux-icc

ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken

Could you tell me what i did wrong? I am new to rpi

EDIT: the error log is : https://pastecode.xyz/view/905135b1

Christian
Guest
Christian

I followed this tutorial. For the Qt 5.12.1. But i keep getting the “opengl test failed problem” I created a vm with ubuntu as host. And a clean rpi with stretch image. “./configure -platform linux-g++-64 -opengl es2 -release -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -skip qtwayland -skip qtlocation -skip qtscript -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm -v” ERROR: Feature ‘opengles2’ was enabled, but the pre-condition ‘config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)’ failed. ERROR: The OpenGL functionality tests failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],… Read more »

Giovanni
Guest

Hey Christian! I’m having the same issue 🙁

Giulio
Guest
Giulio

Anyone has been able to find the solution?

Giulio
Guest
Giulio

I have the same issue:

It can make the 5.12.1 configure step working, but there are something result is wrong.

QPA backends:
EGLFS ……………. yes
EGLFS details:
EGLFS Raspberry Pi …… no

but I’m not able to find a solution!

Alex GTECH
Member

I got this error. It is strange.

None of [libGLESv2.so libGLESv2.a] found in [/home/alex/raspi/sysroot/usr/lib/arm-linux-gnueabihf] and global paths.
=> source produced no result.

I have check those files is really exist, but system can not detected??

Carlos Almeida Jr.
Member

Javier, thanks for all your effort to build this tutorial. It’s more clear than others that I’ve read.

Unfortunately, I was not able to generate QT. The error about undefined reference occurs after run “make install”. I’ve tried many things to fix, but always I’ve got the some related error.

.obj/hunspellinputmethod_p.o: In function QtVirtualKeyboard::HunspellInputMethodPrivate::createHunspell(QString const&)':
hunspellinputmethod_p.cpp:(.text+0x16cc): undefined reference to
qEnvironmentVariable(char const*)’
.obj/hunspellworker.o: In function QtVirtualKeyboard::HunspellAddWordTask::alternativeForm(QString const&, QString&)':
hunspellworker.cpp:(.text+0xb04): undefined reference to
QString::isLower() const’
collect2: error: ld returned 1 exit status
Makefile:94: recipe for target ‘../../../../lib/libQt5HunspellInputMethod.so.5.12.0’ failed
make[5]: *** [../../../../lib/libQt5HunspellInputMethod.so.5.12.0] Error 1

Do you know what could cause this error?

Carlos Almeida Jr.
Member

This is a collateral effect after opting by this https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/#comment-46 However, I tried before with the recommended compiler and I wasn’t happy. 🙁 In file included from ../../include/QtCore/qglobal.h:1:0, from ../corelib/global/qt_pch.h:56: ../../include/QtCore/../../src/corelib/global/qglobal.h:121:49: error: static assertion failed: Required feature library for file ../../include/QtCore/../../src/corelib/plugin/qlibrary.h not available. # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) ^ ../../include/QtCore/../../src/corelib/global/qglobal.h:87:36: note: in expansion of macro ‘Q_STATIC_ASSERT_X’ #define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, “Required feature ” #feature ” for file ” FILE ” not available.”) ^ ../../include/QtCore/../../src/corelib/plugin/qlibrary.h:45:1: note: in expansion of macro ‘QT_REQUIRE_CONFIG’ QT_REQUIRE_CONFIG(library);

Carlos Almeida Jr.
Member

Javier, I restarted the installation from a clean raspbian install and it worked. 🙂
However, I face some problems in QT Creator not recognizing the syntax of the files. The first error message is “qglobal.h: 45:12: fatal error: file ‘type_traits’ not found”

I’m feeling a bit tired and sad in realizing how difficult and silly it is to waste a lot of time to install QT. There is a lot of efforts of brave people like you to install QT, but it isn’t a deterministic process and it is a bit disappointing. What we could do to make this whole process easier?

Carlos Almeida Jr.
Member

Sorry for the outburst.
I recompile all code again using gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf and was not necessary to apply any fix.

Now I’m testing 5.12.1 version.

nparis
Guest
nparis

Hi Javier,
Thanks for this great article.
Could you tell me how to add the openCV in this cross-compile chain, please?
Thanks in advance

Mewster
Guest
Mewster

Hello
I’m trying to cross compile QT from Linux to RPi3; I have a question regarding QtWebEngine.
According to the documentation, “On Linux, Clang or GCC version 5 or later is required. ” but you are using 4.8.3 toolchain. How is this possible?

Thanks

trackback

[…] To cross-compile QT 5.12.0 on PI just follow https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/ […]

Jonathan Bispo
Member

Hi. Thanks for the post. I can compile on Kubuntu 18.04 and run on Raspberry 3.

But I have a problem when I try to run from QtCreator on Kubuntu.

I’m using analog clock example from Qt.

I receive these error messages:

11:19:11: Starting /usr/local/qt5pi/examples/gui/analogclock/analogclock…

Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
Could not link shader program:
“”
QOpenGLShaderProgram: could not create shader program
QOpenGLShader: could not create shader
QOpenGLShaderProgram::uniformLocation(texture): shader program is not linked
QOpenGLShaderProgram::uniformLocation(mat): shader program is not linked

Can you helpe me?

Thanks.

Jonathan Bispo
Member

Another information: I can run the deployed app on rasp, but not from linux host.

Jonathan Bispo
Member

Problem solved. It seems like the lib /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 is wrong. The right lib is /opt/vc/lib/libbrcmGLESv2.so. So, make a backup of /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 and do:

ln -s /opt/vc/lib/libbrcmGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2

I can now run my cross compiled app from Qt Creator on Rasp.

Luis
Guest
Luis

Great tutorial!

Bim Overbohm
Member

If you have problems with OpenGLES not being found, make sure you have libraspberrypi-dev installed on the real RPi system! If you install it after doing Step 4, rsync /opt again!

Giulio
Guest
Giulio

Hi Bim!
I’m trying to cross-compile QT 5.12 but I have the same error. When I configure qtbase the OpenGLES not being found.

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 ………………………. no
EGLFS VSP2 ……………………… no
EGLFS Mali ……………………… no
EGLFS Raspberry Pi ………………. no <– NOT DETECTED
EGLFS X11 ………………………. yes
LinuxFB ………………………….. yen

I tried also to modified the library name into qtbase/mspeck/devices/raspi/ as suggest Javier Bonilla in this tutorial https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/ but without any result.

I have also installed libraspberrypi-dev, but the result is the same.

Giulio
Guest
Giulio

I have just resolved the issue. I modified the qmake.conf for raspberry pi 3 in this way (Adding $$[QT_SYSROOT]):

VC_LIBRARY_PATH = $$[QT_SYSROOT]/opt/vc/lib
VC_INCLUDE_PATH = $$[QT_SYSROOT]/opt/vc/include

VC_LINK_LINE = -L$${VC_LIBRARY_PATH}

QMAKE_LIBDIR_OPENGL_ES2 = $${VC_LIBRARY_PATH}
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBDIR_OPENVG = $$QMAKE_LIBDIR_OPENGL_ES2

Tomas Barton
Guest
Tomas Barton

btw. this change has to be done before the configure script is run for the first time! It seems like VC_INCLUDE_PATH is baked into qmake which is compiled at the first run of configure.

Dusan Arsenijevic
Guest
Dusan Arsenijevic

Thank you Javer for this useful tutorial! Just a note that I have previously managed to build Qt-11.4 using the latest gcc-8.2.0, but with Qt-12.0 Linaro seems to be the only (not too painful) way. Hope we will soon get the breakthrough with 12.4 as well.

Per Frøysa
Guest
Per Frøysa

What version of Raspbian is required? Is Raspbian Stretch with desktop sufficient or is Raspbian stretch with desktop and recommended software the one to go for. I guess my preferred Raspbian Stretch Lite cannot be used if I want to follow your tutorial?

Mewster
Guest
Mewster

I used the lite version

jetsper
Guest
jetsper

Hello Javier,
I was able to cross compile Qt 5.12.2 using your tutorial but I had to change the used build configuration file from “linux-rasp-pi3-g++” to “linux-rasp-pi-g++” (changing this, the issue about open GL not being found was fixed). Maybe this information will help others.

Onclebob
Guest
Onclebob

Hello, thanks for the clear explanations 🙂 but….. I’m on Debian 9, everything seems to works fine but I do not get any QT Creator executable file after the make, many others are there (qtdiag and others). I went through the log and find this in the very beginning : /home/pi/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard –sysroot=/home/pi/raspi/sysroot -O2 -std=gnu++1y -w -fPIC -I. -I/home/pi/raspi/qt-everywhere-src-5.12.2/qtbase/mkspecs/devices/linux-rasp-pi-g++ -o main.o main.cpp main.cpp:5:4: error: #error __cplusplus must be > 201103L (the value of C++11) # error __cplusplus must be > 201103L (the value of C++11) ^ Makefile:177 : la recette pour la cible « main.o »… Read more »

Onclebob11
Member

(Same user, I wasnt logged in for my first post) Just in case it could be usefull : Building on: linux-g++ (x86_64, CPU features: mmx sse sse2) Building for: devices/linux-rasp-pi-g++ (arm, CPU features: ) Target compiler: gcc 4.8.3 Configuration: cross_compile compile_examples enable_new_dtags largefile precompile_header shared rpath release c++11 concurrent dbus reduce_exports stl Build options: Mode …………………………….. release Optimize release build for size …….. no Building shared libraries ………….. yes Using C standard ………………….. C11 Using C++ standard ………………… C++11 Using ccache ……………………… no Using gold linker …………………. no Using new DTAGS …………………… yes Using precompiled headers ………….. yes Using LTCG… Read more »

Mewster
Guest
Mewster

This is not used to create QTCreator, but just to create the libs.
QTCreator is just an IDE (like Visual Studio)

Onclebob11
Member

Thank you, so I will just download and install QT installer file and install it on my desktop Debian then crosscompile to my pi 🙂

Pourya Torabi
Member

Hi, I have done this procedure many times but I always get a “segmentation fault” error, how to solve it?

Andy Long
Guest

Hi, I’m pulling by hair out with QT cross compilation for Pi. This tutorial is one of the best out there but I’m still struggling to get over an issue in QT where it can’t find QCoreApplication, QQmlApplicationEngine, QStringLiteral, etc on a simple blank QtQuick test project. The toolchain seemed to compile and make OK, only complaining about Qtdoc, I’ve tried 5.12.0 and copying in the patch files, 5.12.1 and 5.12.2, all exhibit the same. I’m running this on a Ubuntu 18.04.2 VM ware Box. My feeling is that it’s a path or environment issue, but I’m no guru on… Read more »

Andy Long
Guest
Junior
Guest
Junior

Hi while i am debuging my projects qt creator shows this message

Do you need “set solib-search-path” or “set sysroot”?Could not load shared library symbols for 3 libraries, e.g. /usr/local/qt5pi/qml/QtQuick/Controls

it is shown for more than one library it’s like gdb server does not see the libraries. and when i want to #include some standard c++ libraries in project it also does not see. The strangest thing is that the program however runs with this errors. Is there a solution for this topic?

Junior
Guest
Junior

I forgot to mention that program works for Qt libraries despite the errors. It does not work fork the others. I’ll be appreciated for any help. I am facing this problem for couple weeks and I’ve searched in many forums and pages in the internet and still haven’t gotten an answer.

Junior
Guest
Junior

I’ve done some analysis and I think the problem is with the GDB. I’ve created gui in qml which work good. But I am not able to write any background code in c++ becouse the debuger doesn’t see the libraries. I have no idea what is going on. Do i need to make whole process from this page for cross compilation again from the beginning ? I am running out of the ideas. This tutorial is the only one that i found and seems to work, but maybe i am doing something wrong ?

Mewster
Guest
Mewster

Put in GDB’s startup commands “set solib-search-path /home/yourname/raspi/qt5pi/lib”.
Gdb gets confused about the “real” lib folder.

Junior
Guest
Junior

Ok now i am totaly confused. I’ve done carefully the whole cross compilation process again and set the solib search patch as Mewster suggest but it seems that the problem still egsists. I’ve added a g++ compiler is it ok ? Mean while i will try do something again.

Junior
Guest
Junior

Do you think that the problem could be with installed gdb on raspberry Pi ?
i’ll try to reinstall raspian and see if it helps

shares