Getting started QT cross-compile to Rpi4
-
Ok, so I took a desktop that I had laying around and installed Debian Linux on it. I have now installed QT Creator on that laptop. I tried to follow the directions here to be able to cross-compile on the pi, but everything breaks down right about the time I'm supposed to configure (step 10).
I also tried to use this blog along with the wiki, and again, I get lost right around the configure command.
Does anyone have a "Install this in 5 easy steps for cross-compiling between Linux and Pi" blog I could follow? I can't imagine it is this hard to write gui software for a Rpi.
-
@MichRX7 said in Getting started QT cross-compile to Rpi4:
I can't imagine it is this hard to write gui software for a Rpi.
Cross compilation is not an easy task in general.
Writing GUI apps directly on RPi is as easy as on PC.If you have problems with cross compilation you should say what you did and what was the problem.
-
@jsulm Well, I guess the question is should I just jump on the Pi, open a browser and install QT/Creator on the Pi? I'm more than happy to do that, lol...
But, what I did this time around is I took an unsed PC I had lying around and installed Debian on it, then I opened a browser and installed QT 5.14.1, then I tried to follow the wiki and the blog I reference above, but utilizing the newest version of QT instead of their older version in the posts. Everything seemed to be going well until I hit the compile/make sections of both posts and I start receiving errors.
Here is what I'm entering for the configure:
./configure -release -opengl es2 -device <rpi-version> -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 -vHere is what is returned
bash: rpi-version: No such file or directoryI also tried:
./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -vHere is the output from that:
- cd qtbase
- /root/raspi/qt-everywhere-src-5.14.1/qtbase/configure -top-level -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -v
Creating qmake...
make: Nothing to be done for 'first'.
Command line: -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -v
Project ERROR: Cannot run target compiler '/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++'. Output:
===================
sh: 1: /opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++: not found
===================
Maybe you forgot to setup the environment?
So, now I try and figure out where to go from there...
-
@koahnig said in Getting started QT cross-compile to Rpi4:
Possibly a stupid question but did you install the cross-compiler and is it available in the specified location?
No question is stupid, because I am a Linux/qt newbie.
So, if I look on the Linux pc (not the Pi) I do not see anything in /opt/ (aka, no raspberry directory) which I guess answers that. Did I miss a step on installing this?
-
Regardless where you compile you need to install a proper compiler for the RPi.
Therefore, either compiling on Windows or Linux you need a cross-compiler for cross-compiling. If you would compile of RPi directly, you need to have there a proper compiler too. However, you wouldnot call it cross-compiler then.
Typically the guidelines found shall give you some hint on where to find a suitable cross-compiler for your task. Check the RPi user fora for that.
-
@koahnig Thanks for the reply. Would those links I shared be the correct one's? I thought it would build the directories and files for the Pi and the Cross-Compile machine. Obviously I did something wrong, but if I knew they were what I was looking for I'd try again (and again, and again, lol...)
-
This link looks fine to me. https://www.ics.com/blog/configuring-qt-creator-raspberry-pi
No guarantee since I simply checked what is there. If you have follwed this already partly. You have missed to setup the cross-compiler of step 3.
For step 4 I would go for a newer version of Qt. Version 5.7 is a bit dusty already. Maybe checkout Qt5.14.1 or one of Qt5.12.x versions. -
Did you(or anyone else) got it running by now? And if yes, how?
I also always get stuck at step 10 no matter what guide I used (about 9 different ones)
and I would consider myself as not new at linux or/and qt creator.
I got Android cross compiling up and
running but raspberry seems to be a struggle/chellange by itself.