Unsolved Failure to build QT5 5.10.1 (and 5.11.3, 5.12.) on Raspberry Pi 3
-
@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/
-
@sierdzio Oh, you're right, didn't notice that. Then there is reason to complain :-)
-
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
-
@sierdzio no. It is not cross compiling anything, it is working around the fact that qt configure is stupid.
-
@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.
-
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. -
@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!