I'm trying to create a Qt application that will run embedded on a Raspberry Pi 3. I followed this guide for cross-compiling and was able to run the example qopenglwidget on the Pi correctly. Now my problem is that I would like to build on my Macbook Pro in Qt Creator, but I have no idea how to now deploy to the device. All the guides I've seen online haven't explained what's actually going on and I have no idea how to build a cross compiler on my Mac. Could anyone point me in the right direction about how to do this?
Asked
Active
Viewed 1,508 times
1 Answers
0
So you have already compiled an example on your mac that runs on your raspberry pi?
This means you already have a cross compiler. The guide you linked got a prebuild toolchain from https://github.com/raspberrypi/tools
But I think those are only for ubuntu. When building Qt you need to specify the toolchain in the configure line:
-device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- \
This is the path to the cross compiler you compile Qt with. Did this work for you or did you modify this line?
If you want to build a cross compiler yourself you can follow this guide, although I wasn't able to compile Qt with this compiler.
If you have compiled Qt and the examples work on your Pi, you can add a new kit in Qt Creator on your Mac:
- Open Qt-Creator -> Preferences:
- Under Devices, add a new Generic Linux Device and follow the assistant
- Add a new kit, choose a Generic Linux Device as well and specify the device you just added, your compiler you used to build Qt, the debugger if you have built one with you compiler and the Qt Version you compiled.
- You should be able to build your project with this kit and it will deploy to your device
Tell us if you were successful.

jlsiewert
- 3,494
- 18
- 41