Cross compile Qt 5.12.5 for raspberry pi 4



  • Hi,

    After a lot of head banging trying to make this work, I've managed to compile QT 5.12.5 on an Ubuntu VM, and successfully deploy & Run code from QT Creator into RPI4.

    I'm using QT Creator 4.11.0 which I've installed directly from QT website binaries.

    My Raspberry PI 4 is running Raspbian GNU/Linux 10 (buster).
    My Ubuntu is 18.04.3 LTS.

    I've compiled QT 5.12.5 using the following Configure command:
    ./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 -make examples -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm

    I've followed a tutorial which advised to substitute all references to -lEGL and -LGLESv2 for -lbrcmEGL and -lbrcmGLESv2, respectively in file ./qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf, before compiling, which I did.

    The odd thing is, GUI programs don't show any output when running from QT Creator. Creator reports no error, and I can see a process for the program in question running on the remote machine, but no output is generated in either host or remote machine.
    If I walk to the remote machine and run the program directly it works without issues.
    My RPI is connected to a 10" HDMI screen.

    I've used raspi-config to set the GL driver to Legacy, since the "GL (fake KMS) Open GL Desktop driver" would result in error "failed to add service - Allready in use?" in QT Creator.

    I've tested X11 output between Windows 10 and RPI, using putty and xming.
    I can successfully launch any application, except the ones generated in QT Creator, which again, run but produce no output.
    Non-QT Project / Plain C Application, successfully runs and shows appropriate output in QT Creator/Application Output tab.

    What might be the problem?

    Many thanks in advance.
    José Caeiro



  • Do you mean 'no output' is 'lcd hdmi display'?
    Did you try to run console application?
    I am wondering about the life of the process and a debug message from rpi.



  • Hi isdsi,

    I've built a small Qt Console Application which seems to run fine. Output appears in QT Creator "Application Output" tab. (not really sure if I'm supposed to see any output in the remote system).



  • Try running application in RPI with --platform eglfs and see if the problem exists. I think Qt creator automatically adds this argument to ssh-deployed program



  • Can you please provide a link to the tutorial regarding the substitution of " -lEGL and -LGLESv2 for -lbrcmEGL and -lbrcmGLESv2, respectively in file ./qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf"



  • @JoeBot said in Cross compile Qt 5.12.5 for raspberry pi 4:

    Can you please provide a link to the tutorial regarding the substitution of " -lEGL and -LGLESv2

    I guess he followed this tutorial, pay attention to step #6.



  • Hello.

    I have exactly the same problem with gui not showing on the target device (Raspberry Pi 4). I followed the same tutorial and apps compile on the Pi and I can run them by double-clicking or from terminal but not from Qt Creator directly. I found here to try setting the DISPLAY environment variable in the RUN configuration in Qt Creator. I did as the author of the thread but with no success. The app deploys and runs, I can see it in the processes list but doesn't show on the screen. Has anyone found the solution for this?

    Thanks.


Log in to reply