DEV Community

Cover image for Please help me by writing a working tutorial about cross-compiling qt for a raspberry pi zero w
Jack
Jack

Posted on

Please help me by writing a working tutorial about cross-compiling qt for a raspberry pi zero w

I was using 17 tutorials on the subject and got nothing. I found the discussion to this official qt tutorial:

This entire process is utterly broken.. Bad links, code that wont compile, scripts that don't work.. did you even try any of it?????
Ive added changes to the wiki that have not been moderated yet..
If you provide a "how to" consider the following...
1) keep it updated or 2) step aside and let someone else do it..
Its the official QT wiki at least this one should be right...

... and ...

It looks like this page hasn't been properly updated in about two
years. Dead links all round etc. I'm currently trying to set up a
cross compiler so that I can compile an application on my PC and then
ssh it over to the Raspberry Pi. I'll try and get it working following
these steps and try editing the article where things don't seem to be
working. Jonnax (talk) 15:02, 12 June 2015 (UTC)

...and to top all of this:

Since the script here uses dead links that redirect to phishing sites.
Perhaps someone could fix and change the script? Jonnax (talk) 17:32,
12 June 2015 (UTC)

Could it be that hard to compile a piece of code for a cheap ARM? Aren't people paying fees starting at 500USD a month for the Qt toolkit to get something like that?

I got it working to cross-compile for android OS, windows OS, mac OS and different flavors of linux OS (Even arch linux from scratch) but I really stuck and hit the wall (17 times:) at this little piece of hardware.

Alt Text

So my question is: Would anyone kindly please write a working tutorial here that covers the topic? (The stack-exchange for raspberry pi qt Tag is full of questions about this topic but no answers yet.)

When I got it working somehow I will write it myself and in addition host the virtual box images for free on my server to spare the struggle and keep the source updated.


Most tutorials are working with some broken links for older ubuntu OS versions and broken links to older raspian OS versions so I guess it would be most beneficial if the tutorial is created for the following (But It's totally up to you if even one would work):

Ubuntu 20.04 LTS https://ubuntu.com/download/desktop

Raspberry Pi OS (previously called Raspbian)
https://www.raspberrypi.org/downloads/

Qt Qt Creator 4.12.2 https://www.qt.io/download-open-source

Virtual Box 6.1 https://www.virtualbox.org/wiki/Downloads

Please help - thanks upfront!


EDIT: I will try out some Docker Blog/Tutorial I just found and tell you if it did it.

What tutorials didn't work (or don't work anymore) and things I tried (To safe you about 3 Weeks of work):

  1. https://www.raspberrypi.org/forums/viewtopic.php?t=83955

  2. https://wiki.qt.io/Raspberry_Pi_Beginners_Guide

  3. https://www.youtube.com/watch?v=lh8lqtgzqYA

  4. https://wiki.archlinux.org/index.php/Cross-compiling_tools_package_guidelines

  5. https://www.raspberrypi.org/forums/viewtopic.php?t=204529

  6. https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/

  7. https://github.com/ElektorLabs/160520-QT-compile-and-install-manual

8.https://www.elektormagazine.com/articles/qt-for-the-raspberry-pi-a-step-by-step-guide-to-set-up-the-gui-framework

  1. https://www.interelectronix.com/de/qt-auf-dem-raspberry-pi-4.html

  2. https://wiki.qt.io/RaspberryPi2EGLFS

  3. https://github.com/neuronalmotion/qtrpi

  4. https://www.ics.com/blog/configuring-qt-creator-raspberry-pi

  5. http://thebugfreeblog.blogspot.com/2012/11/bring-up-qt-50-on-raspberry-pi.html

  6. https://stackoverflow.com/questions/13626726/an-error-building-qt-libraries-for-the-raspberry-pi/33254355#33254355

  7. https://medium.com/@amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c

  8. https://forum.qt.io/topic/100994/qt5-12-x-raspberry-pi-zero-cross-compilation-qcoreapplication-error

  9. https://www.raspberrypi.org/forums/viewtopic.php?t=89518

  10. https://github.com/chschnell/build-qt5-rpi/blob/master/build-qt5-rpi.sh

  11. https://www.raspberrypi.org/forums/viewtopic.php?t=204778

Latest comments (1)

Collapse
 
4f profile image
4FF • Edited

Hi,

I think all the 10+ tutorials had wrong compiler targeting newer arm instead of arm6 present on zero.