Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Cross-Platform Raspberry Pi Compilation Issues
bockscaracer last edited by bockscaracer
I've been trying to figure out how to get my code to compile with aarch64. I found QtRpi which provides some magical scripts that wire everything up for you, but I would like to figure this out and understand it all on my own.
I have a Raspberry Pi 3 running Raspbian, and I have all of the Qt libs and compilers installed on it. I have my Linux desktop which also has everything setup to compile x64 applications. I've added my Raspberry Pi as an external device to QtCreator. However I am unable to figure out where to go from here. Everything I compile still uses my x64 compilers, and the Qt version installed on my desktop.
The documentation I've found for cross-platform compilation is extremely obscure and hasn't helped much so far. I have Qt libs on my Pi and I can run Qt applications installed from the software repos. My issue is that I have no idea how to have my desktop machine compile for aarch64.
bockscaracer last edited by
Partly reply to my own question as I suspect I am seeing some kind of bug with QtCreator -
My IoT device is a Raspberry Pi 3 B+. I've installed QtCreator & all of the Qt 5.7.1 development libs, along with GCC & G++, both of them are arm-linux-gnueabihf. My Qt version is Qt 5.7.1 arm-linux-gnueabihf. Notice that my Compiler and Qt library architectures match.
When I setup my kit on my Pi 3 via QtCreator, I get a warning that states Device type is not supported by Qt version. Despite this, I am able to compile Qt 5.7.1 compatible code without any problems at all (from on my Raspberry Pi).
However, I am still stumped as to why I am unable to cross-compile with QtCreator on my desktop despite having my Pi 3 device configured correctly. When I select the kit that contains my Pi 3, I now see this warning -
:-1: warning: "/usr/bin/gcc" is used by qmake, but "/usr/bin/arm-none-eabi-gcc-7.3.0" is configured in the kit. Please update your kit or choose a mkspec for qmake that matches your target environment better.
Problem is, I can't seem to find or otherwise select any other Qt version or qmake on my desktop. I tried using qmake via ssh from my Desktop to the Pi 3, but the configuration won't save.
bockscaracer last edited by
Haven't had anybody respond to this thread so I'll post another update.
I have somewhat given up on cross-compiling from my Desktop to my rpi via QtCreator. I even tried out the QtRpi script and it failed when trying to create the folders and libs on the Pi.
I do have a workaround, albeit a pretty old-school one - just use SSH.
The applications I write are pretty small so it's not a problem to just have the Pi itself compile all the code. Here are the steps I follow:
- I write & test my code on my development platform (right now it is Manjaro Linux, but it would be Windows just the same)
- Check the source code into GitHub
- SSH into my rpi
- Pull the code I checked in step #2
- Run Make and all the other Qt goodies from the terminal - no QtCreator needed.
The only thing I haven't quite figured out yet is now to configure the project from the command line, the way QtCreator configures a project the first time you open it. Other than that, this method works out of the box and I highly recommend it over spending hours or days trying to get cross-compilation working on the rpi.
With QtRPI script, you mean from here ?
Yes cross compiling is a time sink.