Try to cross compile QT on raspbery pi2
-
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.0I 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:
with 5.4.1:
- 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:
cd ~/my_Qt_install_path/qtbase/include
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:
cd ~/my_Qt_install_path/qtbase/include/interface/vcos/pthreads
cp * ../.
3°) push all header files related to vmcs_host/linux, one step upper in the hierarchy tree, right into vmcs_host directory
cd ~/my_Qt_install_path/qtbase/include/interface/vmcs_host/linux
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.
-
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?Thanks
-
no, I don't know