I got this error in make step
qeglfsbrcmintegration.cpp:35:22: fatal error: bcm_host.h: No such file or directory
make: *** [.obj/qeglfsbrcmintegration.o] Error 1
make: Leaving directory `/home/hamed/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm'
make: *** [sub-eglfs_brcm-make_first] Error 2
make: Leaving directory `/home/hamed/raspi/qtbase/src/plugins/platforms/eglfs/deviceintegration'
make: *** [sub-deviceintegration-make_first-ordered] Error 2
make: Leaving directory `/home/hamed/raspi/qtbase/src/plugins/platforms/eglfs'
make: *** [sub-eglfs-make_first] Error 2
make: Leaving directory `/home/hamed/raspi/qtbase/src/plugins/platforms'
make: *** [sub-platforms-make_first] Error 2
make: Leaving directory `/home/hamed/raspi/qtbase/src/plugins'
make: *** [sub-plugins-make_first] Error 2
make: Leaving directory `/home/hamed/raspi/qtbase/src'
make: *** [sub-src-make_first] Error 2
hamed@hamed-PC ~/raspi/qtbase $
- 1 I edited this topic to add the solution to this error (fatal error: bcm_host.h: No such file or directory)
- 2 QT Serial Port install in cross-compile environment
- 3 Prerequisites to run cross compile tools on fresh Ubuntu/Debian x64
- 4 X C Bindings
- 5 Illegal instruction
- 6 libinput not detected by configure script
- 7 could not find or load the Qt platform plugin "eglfs"
- 8 Initial
- 9 small fix to the relativelink fixing script
- 10 Ansible Roles/Playbooks Based on this Article
- 11 Minor improvement to step 8
- 12 Recommended changes to step 11
- 13 Recommended changes to Step #15
- 14 Suggestion of changes to step 14
- 15 Step #15 Problems
- 16 Cross compilation on 64bit machines TIP
- 17 Never script your Terminal output to a .log file.
I edited this topic to add the solution to this error (fatal error: bcm_host.h: No such file or directory)
to solve this problem just add these lines
INCLUDEPATH += $[QT_SYSROOT]/opt/vc/include
INCLUDEPATH += $[QT_SYSROOT]/opt/vc/include/interface/vcos
INCLUDEPATH += $[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads
INCLUDEPATH += $[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
to these two files: "qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf"
after save the files repeat these two steps "configure" and "make"
the refrence is this thread
Different error in the make step http://stackoverflow.com/questions/34685488/qt-5-6-cross-compile-for-raspberry-pi-with-eglfs
QT Serial Port install in cross-compile environment
I am attempting to adapt the instructions linked here: Qt Serial Port to this cross-compile environment. The Qt Serial Port page suggests that Qt Serial Port is included in Qt5, however I cannot seem to find it. Has it been removed? I am running QT 5.4.2. on my host system.
If I have to install Qt Serial Port, then I am not sure how to successfully install it in this cross-compile environment. Can anyone help with this? Thank you!
Prerequisites to run cross compile tools on fresh Ubuntu/Debian x64
To run the tools on a host running Ubuntu / Debian x64, the following libraries are necessary:
$ sudo apt-get install lib32stdc++6 lib32z1 lib32ncurses5
Otherwise, errors like this might occur:
arm-linux-gnueabihf-g++: Command not found
arm-linux-gnueabihf-g++: Kommando nicht gefunden
X C Bindings
I had to add the following parameter to the configure command:
Otherwise the following error is shown:
The test for linking against libxcb and support libraries failed! You might need to install dependency packages, or pass -qt-xcb. See src/plugins/platforms/xcb/README.
I just set up a fresh Ubuntu 14.04 and RPiZero Raspbian.
I followed this tutorial and everything worked (after using the discussion page fixes) except for the example.
I built the example without errors, deployed it, set up the libraries, etc.
When I run the example on the Pi I simply get "Illegal Instruction". Nothing else.
I turned on logging and don't see the log output anywhere that I can find.
EDIT: I don't know if you just want me to delete this. I found the problem. I was building for the pi2 and trying to run it on the pi zero. Sorry about that. I am new to this stuff. I figured out how to build for pi 1 / zero and now everything works. This is awesome!!!
libinput not detected by configure script
Hi. In this excellent tutorial it is said that one must make sure that libinput is set to "yes" in configure's summary report.
I have libinput installed, and the library files and headers are in the sysroot path as required. Yet configure does not detect it. Even when I add the -libinput argument to the configure command line.
The test widget however compiles and runs fine on my Pi2.
Is libinput really required, and why?
could not find or load the Qt platform plugin "eglfs"
After following the tutorial, when running qopenglwidget I get the following error:
This application failed to start because it could not find or load the Qt platform plugin "eglfs" in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
Reinstalling the application may fix this problem. Aborted
Since we are going to build Qt5 for Pi, I don't really get why one must INSTALL certain modules of Qt BEFORE the build?
I just tried this tutorial on a Raspberry Pi 3, and encountered the following problem:
pi@raspberrypi:~ $ sudo apt-get build-dep libqt5gui5 Reading package lists... Done Building dependency tree Reading state information... Done Picking 'qtbase-opensource-src' as source package instead of 'libqt5gui5' The following packages have unmet dependencies: libgles2-mesa-dev : Depends: libegl1-mesa-dev but it is not going to be installed libopenvg1-mesa-dev : Depends: libegl1-mesa-dev but it is not going to be installed E: Build-dependencies for libqt5gui5 could not be satisfied.
Greetings to all from Argentina. I'm trying to install this OpenGL accelerator I have a compilation with lots of errors how can I upload the text file with the screen output? They are many pages of text.
Thank you very much.
The script relinks also systemd files pointing to /dev/null. Although this does not break anything currently, here is a fix Copy the following and paste to shell in the directory where the sysroot-relativelinks.py is
patch <<'EOF' *** sysroot-relativelinks.py~ Fri Apr 28 09:50:57 2017 --- sysroot-relativelinks.py Fri Apr 28 10:56:27 2017 *************** *** 18,23 **** --- 18,25 ---- return if link.startswith(topdir): return + if link.startswith("/dev/"): + return #print("Replacing %s with %s for %s" % (link, topdir+link, filep)) print("Replacing %s with %s for %s" % (link, os.path.relpath(topdir+link, subdir), filep)) os.unlink(filep) EOF
Ansible Roles/Playbooks Based on this Article
I used the instructions here to make Ansible playbooks that perform most of the same steps. The playbooks can set up a Pi, set up a development computer, and then deploy Qt to the Pi. Repo is https://bitbucket.org/johnwoltman/build_qt_for_pi_with_ansible
Minor improvement to step 8
You can combine all 5 commands into one like this:
rsync -avzR firstname.lastname@example.org:/lib :/usr/include :/usr/lib :/opt/vc sysroot
Note that -R preserves the path names and that rsync creates the ./sysroot directory for us.
Hi I have Ubuntu 16.04 x64 and Qt Creator 5.10.1 x64 witch version of qt base should I choose? for compile on raspberry pi 3 with Raspbian stretch x32 OS?
Recommended changes to step 11
the first command in step #11 should be
This is because the previous step ends with you in qtbase when you need to be in raspi
Recommended changes to Step #15
Just including the line:
So that way beginners (like me) know what to do to get it running.
Suggestion of changes to step 14
Make sure you're in "/home/pi" aka "~" when you run these commands:
(This would have saved me an hour...)
Step #15 Problems
You may get this result when you run the example app:
This application failed to start because it could not find or load the Qt plaform plugin "xcb" in "". Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Reinstalling the application may fix this problem Aborted
Additional Debugging gives you this result:
Got keys from plugin meta data ("xcb") QFactoryLoader::QFactoryLoader() checking directory path "/home/pi/platforms" ... Cannot load library /usr/local/qt5pi/plugins/platforms/libqxcb.so: (/usr/local/qt5pi/plugins/platforms/../../lib/libQt5XcbQpa.so.5: symbol_ZTI18QPlatformClipboard, version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference) QLibraryPrivate::loadPlugin failed on "/usr/local/qt5pi/plugins/platforms/libqxcb.so" : "Cannot load library /usr/local/qt5pi/plugins/platforms/libqxcb.so: (/usr/local/qt5pi/plugins/platforms/../../lib/libQt5XcbQpa.so.5: symbol _ZTI18QPlatformClipboard, version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)" This application failed to start because it could not find or load the Qt platform plugin "xcb" in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Reinstalling the application may fix this problem. Aborted
No solution at this time.
Cross compilation on 64bit machines TIP
Hi. When You try to build QT on 64 bit PC without i386 libraries, use:
Never script your Terminal output to a .log file.
The title sums it all up. I began scripting the whole Terminal output to my progress.log file. I followed all steps up until the long ./configure command. It always failed while the compiler was searching for "~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++". The error was:
> Info: creating stash file /home/nikilesh/raspi/qtbase/config.tests/.qmake.stash > Project ERROR: Compiler ~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ not found. Check the value of CROSS_COMPILE -device-option >Note: Also available for Linux: linux-clang linux-icc
>ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
I lost more than four hours finding out the solution, creating a totally separate folder, re-cloning tools from raspberrypi's git, re-cloning qtbase and then again failing thrice with the ./configure command. This was mildly infuriating. A brainwave occurred that made me exit from scripting my .log file. I executed the command simply in plain Terminal and succeeded in it. I recommend everyone who are keen to log their cross-compilation progress to use the "tee" command.
For example, <your command> | tee <file destination>
> $ ./configure -release -opengl es2 -no-openssl -no-dbus -no-use-gold-linker -device linux-rasp-pi3-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 | tee ~/config_progress.log