Try to cross compile QT on raspbery pi2
Hi. I am trying to do this using tutorial here https://wiki.qt.io/RaspberryPi2EGLFS but I can't even configure QT before compiling.
When I execute this line:
./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v
I get some errors like:
ShivaVG auto-detection... () /home/pawel/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/pawel/raspi/sysroot -O2 -Wall -W -fPIC -I. -I../../../../sysroot/opt/vc/include -I../../../../sysroot/opt/vc/include/interface/vcos/pthreads -I../../../../sysroot/opt/vc/include/interface/vmcs_host/linux -I../../../mkspecs/devices/linux-rasp-pi2-g++ -o shivavg.o shivavg.cpp shivavg.cpp:34:23: fatal error: vg/openvg.h: Nie ma takiego pliku ani katalogu #include <vg/openvg.h> ^ compilation terminated. make: *** [shivavg.o] Błąd 1 ShivaVG disabled.
I have this file(s) on my disk but it can't see it. Could you tell me what is going on?!
Do you have those files in the sysroot (~/raspi/sysroot)?
@jsulm yes I have these files.
When I try to compile by make -j4 I got:
qeglfsbrcmintegration.cpp:35:22: fatal error: bcm_host.h: There is no such file or directory
I have this file in ~/raspi/sysroot/opt/include , so I don't idea what is going on...
"/opt/include" is not a standard directory for include files, so I guess you will need to pass it as include directory to configure script.
sorry it is opt/vc/include if it makes difference.
Hi, I have been trying for a number of days/weeks to compile Qt on Raspberry pi2 too.
One of them with Qt 5.4.1, the other one with Qt 5.6.0
I ran into problems regarding missing openvg.h, bcm_host.h, and a couple of other header files more or less related to VCOS.
I did not yet consider a clean and professional solution, just wanted to make the Qt compile run in a first approach, and I could build both configurations (5.4.1 and 5.6.0, details below). I still have 2 major issues:
- I managed to build the demo "cube" Qt program and it runs well, in full screen.
- I managed to build my own QWidget based program, all the gui runs well (in full screen too), the issue is with QBluetooth layer, the "QBluetoothLocalDevice" always returns null (no local BT dongle found), although hciconfig/hcitool/gatttool work well, being able to connect to my external Bt peripheral, to scan, etc..
with Qt 5.6.0:
I can execute qmake and make on my own program, the same as here above, I can launch it, I have writen some QDebug() statements in the constructors, the first one displays something, and then my program aborts with the message:
<<EGL Error : Could not create the egl surface: error = 0x3005>>
Anyway, here is what I did to be able to build Qt on the Pi2, I know it is dirty, but it was just to understand what occured, and it sounds that these issues are long time known, some references to header files are not well addressed:
1°) push all /opt/vc/include header files right into ./qtbase/include directory:
cp -R /opt/vc/include/* .
2°) push all header files related to .../vcos/pthreads directory, one step upper in the hierarchy tree, right into vcos directory:
cp * ../.
3°) push all header files related to vmcs_host/linux, one step upper in the hierarchy tree, right into vmcs_host directory
cp -R * ../.
Only after that I was able to configure / make / make install Qt natively on my Rpi's
The Bluetooth and EGL issues remain, I'm stil working on them.
Hope this could help
Just add this lines to the /mkspecs/devices/linux-rasp-pi2-g++/qmake.conf
# My QMAKE_INCDIR += $$[QT_SYSROOT]/opt/vc/include \ $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads \ $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
this QMAKE_INCDIR is duplicate of QMAKE_INCDIR_EGL, because QMAKE_INCDIR_EGL does not handles by unknown reason.
with single $ or double $ $ before [QT_SYSROOT] ?
Of course, double, as in QMAKE_INCDIR_EGL ... seems that Markdown eat one symbol..
@SGaist, is it a forum's engine bug? because I see from the preview two $ $ symbols.
@kuzulis AFAIK, it's a "feature" of the markdown renderer. I'd say something to ask to the NodeBB folks
@kuzulis I've done what you suggest, and now I still get errors after ./configure but when I do make everything went good without errors.
I got it!! Finally it works :)
But I have a question. Why, when I deploy application from QT to raspberry I can see it only when I connect display with HDMI, but I can't see it when I connect to raspberry through vncviewer? Where are configuration files which tells raspberry to display application on specific device?
@kuzulis do you know?
no, I don't know
I had that same problem. For mine, I had to replace the ~ character with the full pathname for each time it was used in the ./configure command. You'll have to "make clean" first, now that you've run it once.