Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Could not create shader pogram when cross-compiling for Raspbery Pi 3.
Szustarol last edited by
I have recently set up my Qt Creator to build and deploy on raspberry Pi.
I have used these configure options to set up my build:
./configure -release -opengl es2 -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 -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v -no-use-gold-linker -skip qtlocation -skip qtspeech -skip qtwebengine -skip qtandroidextras -skip qtgamepad -skip qtlocation -skip qtpurchasing -skip qtsvg -skip qtwebchannel -skip qtwebsockets -skip qtwebview -skip qtmultimedia -no-harfbuzz -skip qtwayland -no-cups -skip qtscript -skip qtscxml
Then I ran make and make install. It all went smooth.
Now, when I build and run the program in Qt Creator I get the following errors:
QOpenGLShaderProgram: could not create shader program QOpenGLShader: could not create shader Could not link shader program: ""
And the RPi screen goes dark. I can still control the process and stop it. I use SSH key pair to connect.
Strange thing is, when I run the app from within Raspberry Pi it runs just fine, without any issues.
This leads me to believe that there are some issues with the connection. Any ideas to solve this problem?
Where does your shader come from ?
Szustarol last edited by
Well I'm not really sure to be honest. I have just compiled QT from it's source and configured it to run on raspberry pi. It's not a custom shader or something like this.
What version of gcc are you using for the cross-compilation ?
Szustarol last edited by Szustarol
This is the output of --version:
arm-linux-gnueabihf-g++ (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) 4.8.3 20140303 (prerelease) Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
jmg227 last edited by jmg227
I just had the same problem. I was using https://wiki.qt.io/RaspberryPi2EGLFS for instructions on how to do the cross-compiling. It turns out that I had forgotten to do:
step 13, update the ld config on the Raspberry Pi so that it could find the libraries, and
step 14, Fix the EGL/GLES libraries.
One thing I had done differently is that I did update the qmake.conf file to use the Broadcom drivers as recommended at https://bugreports.qt.io/browse/QTBUG-62216. The qmake.conf file that I modified was for linux-rasp-pi-g++
I was building Qt 5.12.3 for a Raspberry Pi 3B running Raspbian Buster. Once I completed these two steps, my application runs without problems.