Failure to build QT5 5.10.1 (and 5.11.3, 5.12.) on Raspberry Pi 3
-
@sierdzio , many thanks for your advice. I'll follow the guide and report back later what happens. I'm surprised there haven't been more complaints about the www.tal.org link.
@BrianInVancouver said in Failure to build QT5 5.10.1 (and 5.11.3, 5.12.) on Raspberry Pi 3:
I'm surprised there haven't been more complaints about the www.tal.org link.
As far as I can see this tutorial doesn't say that it does cross compilation.
And it says that it is building on RaspberryPi: "Building Qt on the Raspberry Pi is quite straightforward and in short consist of the following steps"
So no reason to complain about it. -
@BrianInVancouver said in Failure to build QT5 5.10.1 (and 5.11.3, 5.12.) on Raspberry Pi 3:
I'm surprised there haven't been more complaints about the www.tal.org link.
As far as I can see this tutorial doesn't say that it does cross compilation.
And it says that it is building on RaspberryPi: "Building Qt on the Raspberry Pi is quite straightforward and in short consist of the following steps"
So no reason to complain about it.@jsulm said in Failure to build QT5 5.10.1 (and 5.11.3, 5.12.) on Raspberry Pi 3:
As far as I can see this tutorial doesn't say that it does cross compilation.
-device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/usr/bin/
-
@jsulm said in Failure to build QT5 5.10.1 (and 5.11.3, 5.12.) on Raspberry Pi 3:
As far as I can see this tutorial doesn't say that it does cross compilation.
-device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/usr/bin/
-
I followed the instruction from RaspberryPi2EGLFS and mostly works, but found some issues. I describe here the steps I followed in case someone is interested.
https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi
-
Nice! Thanks for sharing
-
@jsulm said in Failure to build QT5 5.10.1 (and 5.11.3, 5.12.) on Raspberry Pi 3:
As far as I can see this tutorial doesn't say that it does cross compilation.
-device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/usr/bin/
@sierdzio no. It is not cross compiling anything, it is working around the fact that qt configure is stupid.
-
Following the instructions in http://www.tal.org/tutorials/building-qt-510-raspberry-pi-debian-stretch, I installed database support, X11 support and Wayland support packages. Although the ./configure completes successfully, the Make fails:
/usr/bin/g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard -O2 -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -D_REENTRANT -fPIC -DQT_NO_FOREACH -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_XCB_QPA_LIB_LIB -DQT_SERVICE_SUPPORT_LIB -DQT_THEME_SUPPORT_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_EGL_SUPPORT_LIB -DQT_GUI_LIB -DQT_EDID_SUPPORT_LIB -DQT_DBUS_LIB -DQT_CORE_LIB -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl -I. -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/plugins/platforms/xcb/gl_integrations -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/plugins/platforms/xcb -isystem /usr/include/libdrm -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtServiceSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtServiceSupport/5.12.0 -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtServiceSupport/5.12.0/QtServiceSupport -I../../../../../../include -I../../../../../../include/QtServiceSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtThemeSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtThemeSupport/5.12.0 -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtThemeSupport/5.12.0/QtThemeSupport -I../../../../../../include/QtThemeSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtFontDatabaseSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtFontDatabaseSupport/5.12.0 -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtFontDatabaseSupport/5.12.0/QtFontDatabaseSupport -I../../../../../../include/QtFontDatabaseSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtEglSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtEglSupport/5.12.0 -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtEglSupport/5.12.0/QtEglSupport -I../../../../../../include/QtEglSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtGui/5.12.0 -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtGui/5.12.0/QtGui -I../../../../../../include/QtGui/5.12.0 -I../../../../../../include/QtGui/5.12.0/QtGui -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtGui -I../../../../../../include/QtGui -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtEdidSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtEdidSupport/5.12.0 -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtEdidSupport/5.12.0/QtEdidSupport -I../../../../../../include/QtEdidSupport -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtCore/5.12.0 -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtCore/5.12.0/QtCore -I../../../../../../include/QtCore/5.12.0 -I../../../../../../include/QtCore/5.12.0/QtCore -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtDBus -I../../../../../../include/QtDBus -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtCore -I../../../../../../include/QtCore -I.moc -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/3rdparty/xcb/include -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/3rdparty/xcb/sysinclude -I/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/mkspecs/devices/linux-rasp-pi-g++ -o .obj/qxcbeglwindow.o /home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp
/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp: In member function ‘virtual void QXcbEglWindow::create()’:
/home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp:96:81: error: invalid conversion from ‘xcb_window_t {aka unsigned int}’ to ‘EGLNativeWindowType {aka void*}’ [-fpermissive]
e = eglCreateWindowSurface(m_glIntegration->eglDisplay(), m_config, m_window, 0);
^~~~~~~~
In file included from /home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtEglSupport/5.12.0/QtEglSupport/private/../../../../../src/platformsupport/eglconvenience/qt_egl_p.h:65:0,
from /home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/include/QtEglSupport/5.12.0/QtEglSupport/private/qt_egl_p.h:1,
from /home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglinclude.h:49,
from /home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.h:45,
from /home/pi/Downloads/qt5/qt-everywhere-src-5.12.0/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp:40:
/opt/vc/include/EGL/egl.h:265:31: note: initializing argument 3 of ‘void* eglCreateWindowSurface(EGLDisplay, EGLConfig, EGLNativeWindowType, const EGLint*)’
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
^~~~~~~~~~~~~~~~~~~~~~
Makefile:1945: recipe for target '.obj/qxcbeglwindow.o' failed
make[7]: *** [.obj/qxcbeglwindow.o] Error 1
make[7]: Leaving directory '/home/pi/Downloads/qt5/build/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl'
Makefile:44: recipe for target 'sub-xcb_egl-make_first' failed
make[6]: *** [sub-xcb_egl-make_first] Error 2
make[6]: Leaving directory '/home/pi/Downloads/qt5/build/qtbase/src/plugins/platforms/xcb/gl_integrations'
Makefile:148: recipe for target 'sub-gl_integrations-make_first-ordered' failed
make[5]: *** [sub-gl_integrations-make_first-ordered] Error 2
make[5]: Leaving directory '/home/pi/Downloads/qt5/build/qtbase/src/plugins/platforms/xcb'
Makefile:100: recipe for target 'sub-xcb-make_first' failed
make[4]: *** [sub-xcb-make_first] Error 2
make[4]: Leaving directory '/home/pi/Downloads/qt5/build/qtbase/src/plugins/platforms'
Makefile:102: recipe for target 'sub-platforms-make_first' failed
make[3]: *** [sub-platforms-make_first] Error 2
make[3]: Leaving directory '/home/pi/Downloads/qt5/build/qtbase/src/plugins'
Makefile:774: recipe for target 'sub-plugins-make_first' failed
make[2]: *** [sub-plugins-make_first] Error 2
make[2]: Leaving directory '/home/pi/Downloads/qt5/build/qtbase/src'
Makefile:48: recipe for target 'sub-src-make_first' failed
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory '/home/pi/Downloads/qt5/build/qtbase'
Makefile:81: recipe for target 'module-qtbase-make_first' failed
make: *** [module-qtbase-make_first] Error 2
pi@raspberrypi:~/Downloads/qt5/build $I've repeated the steps for 5.11.3, and 5.12.0 (the later, using both the New way and Old way of configuring the Qt build) with the same results. I'm using linux-rasp-pi2-g++ as the platform option.
I've taken precaution to increase the swapsize to 1024 (more than the 200 recommended).
However, I do not one issue. When I run configure, I do note one issue: the EGLFS Rasberry Pi is not recognized. In other words, I see this:
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
...
EGLFS Rasberry Pi .................... noTo be frank, my background is in the Windows environment, so I'm a bit of a fish out of water, and am open to some advice. I don't believe I need EGLFS as I'm quite happy to run my QT5 applications in the existing Debian Stretch windowing environment.
What should be my next steps?
@BrianInVancouver Did you fix the EGL library names as instructed ? Make sure that configure does find the libraries and if not check the configure log for the reason.
-
@sierdzio no. It is not cross compiling anything, it is working around the fact that qt configure is stupid.
And by stupid I mean this:
$ ../qt-everywhere-src-5.12.0/configure -v -opensource -confirm-license -release -device linux-rasp-pi-g++
....
....
Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>It assumes that if you are building with a device configuration, then you must be cross compiling, even if you are on a native system.
And yes, some of us prefer doing native builds. For reasons. And no it's not "slow" on Pi3 anymore.
-
And by stupid I mean this:
$ ../qt-everywhere-src-5.12.0/configure -v -opensource -confirm-license -release -device linux-rasp-pi-g++
....
....
Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>It assumes that if you are building with a device configuration, then you must be cross compiling, even if you are on a native system.
And yes, some of us prefer doing native builds. For reasons. And no it's not "slow" on Pi3 anymore.
@oniongarlic said in Failure to build QT5 5.10.1 (and 5.11.3, 5.12.) on Raspberry Pi 3:
And by stupid I mean this:
$ ../qt-everywhere-src-5.12.0/configure -v -opensource -confirm-license -release -device linux-rasp-pi-g++
....
....
Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>It assumes that if you are building with a device configuration, then you must be cross compiling, even if you are on a native system.
And yes, some of us prefer doing native builds. For reasons. And no it's not "slow" on Pi3 anymore.
Mate, in that case just skip the
-device
part... it works. I have compiled Qt on Rasperry Pi natively many times. If you want to pass special config to make sure the OpenGL paths etc. are correct, you can create a new makespec and pass it to configure using the-platform
flag.That's how it works: if you specify
-device
Qt will attempt to cross-compile. If you specify-platform
it assumes a native build. There is no need to blame your misuse of the configuration script on Qt. It is true, though, that the mkspecs for RPi are often buggy. -
@oniongarlic said in Failure to build QT5 5.10.1 (and 5.11.3, 5.12.) on Raspberry Pi 3:
And by stupid I mean this:
$ ../qt-everywhere-src-5.12.0/configure -v -opensource -confirm-license -release -device linux-rasp-pi-g++
....
....
Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>It assumes that if you are building with a device configuration, then you must be cross compiling, even if you are on a native system.
And yes, some of us prefer doing native builds. For reasons. And no it's not "slow" on Pi3 anymore.
Mate, in that case just skip the
-device
part... it works. I have compiled Qt on Rasperry Pi natively many times. If you want to pass special config to make sure the OpenGL paths etc. are correct, you can create a new makespec and pass it to configure using the-platform
flag.That's how it works: if you specify
-device
Qt will attempt to cross-compile. If you specify-platform
it assumes a native build. There is no need to blame your misuse of the configuration script on Qt. It is true, though, that the mkspecs for RPi are often buggy.@sierdzio well, every instruction I found many years ago when I had to get Qt 5 up and running always used -platform even when doing native builds and faking it with CROSS_COMPILE pointing to local tools to get the correct device specific build flags.
And using -platform linux-rasp-pi-g++ (as one would assume that would be the native option) just complains:
The specified system/compiler is not supported: /home/pi/qt/qt-everywhere-src-5.12.0/qtbase/mkspecs/linux-rasp-pi-g++
It is not very clear what you are supposed to do at this point. And I spent days trying to figure this out and always something that didn't work or didn't get detected properly.
That is why I wrote a guide with instructions that worked-for-me and got me a working Qt on my Pis. Might not be the "correct way", but works for me.
-
A native mkspec is
linux-g++
.Anyway, good, if it works for you and your guide helps others - that's great!