Please help me by writing a working tutorial about cross-compiling qt for a raspberry pi zero w
Tags: cpp, raspberrypi, qt, crosscompiling
Published: 2020-06-18 22:01:53

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

> 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](https://dev-to-uploads.s3.amazonaws.com/i/8x35ae7hx5ol3mhniald.jpg)

***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.)][2]*

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][3]
> 
> `Raspberry Pi OS` *(previously called Raspbian)*
> [https://www.raspberrypi.org/downloads/][4]
> 
> `Qt Qt Creator 4.12.2` [https://www.qt.io/download-open-source][5]
> 
> `Virtual Box 6.1` [https://www.virtualbox.org/wiki/Downloads][6]

Please help - thanks upfront!

___

*EDIT: I will try out some [Docker Blog/Tutorial][7] 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][8]

2. [https://wiki.qt.io/Raspberry_Pi_Beginners_Guide][9]

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

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

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

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

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

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

9. [https://www.interelectronix.com/de/qt-auf-dem-raspberry-pi-4.html][16]

10. [https://wiki.qt.io/RaspberryPi2EGLFS][17]

11. [https://github.com/neuronalmotion/qtrpi][18]

12. [https://www.ics.com/blog/configuring-qt-creator-raspberry-pi][19]

13. [http://thebugfreeblog.blogspot.com/2012/11/bring-up-qt-50-on-raspberry-pi.html][20]

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

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

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

17. [https://www.raspberrypi.org/forums/viewtopic.php?t=89518][24]

18. [https://github.com/chschnell/build-qt5-rpi/blob/master/build-qt5-rpi.sh][25]

19. [https://www.raspberrypi.org/forums/viewtopic.php?t=204778][26]


  [1]: https://wiki.qt.io/Talk:Raspberry_Pi_Beginners_Guide
  [2]: https://raspberrypi.stackexchange.com/questions/tagged/qt
  [3]: https://ubuntu.com/download/desktop
  [4]: https://www.raspberrypi.org/downloads/
  [5]: https://www.qt.io/download-open-source
  [6]: https://www.virtualbox.org/wiki/Downloads
  [7]: https://www.qt.io/blog/docker-builds-from-qtcreator
  [8]: https://www.raspberrypi.org/forums/viewtopic.php?t=83955
  [9]: https://wiki.qt.io/Raspberry_Pi_Beginners_Guide
  [10]: https://www.youtube.com/watch?v=lh8lqtgzqYA
  [11]: https://wiki.archlinux.org/index.php/Cross-compiling_tools_package_guidelines
  [12]: https://www.raspberrypi.org/forums/viewtopic.php?t=204529
  [13]: https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/
  [14]: https://github.com/ElektorLabs/160520-QT-compile-and-install-manual
  [15]: https://www.elektormagazine.com/articles/qt-for-the-raspberry-pi-a-step-by-step-guide-to-set-up-the-gui-framework
  [16]: https://www.interelectronix.com/de/qt-auf-dem-raspberry-pi-4.html
  [17]: https://wiki.qt.io/RaspberryPi2EGLFS
  [18]: https://github.com/neuronalmotion/qtrpi
  [19]: https://www.ics.com/blog/configuring-qt-creator-raspberry-pi
  [20]: http://thebugfreeblog.blogspot.com/2012/11/bring-up-qt-50-on-raspberry-pi.html
  [21]: https://stackoverflow.com/questions/13626726/an-error-building-qt-libraries-for-the-raspberry-pi/33254355#33254355
  [22]: https://medium.com/@amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c
  [23]: https://forum.qt.io/topic/100994/qt5-12-x-raspberry-pi-zero-cross-compilation-qcoreapplication-error
  [24]: https://www.raspberrypi.org/forums/viewtopic.php?t=89518
  [25]: https://github.com/chschnell/build-qt5-rpi/blob/master/build-qt5-rpi.sh
  [26]: https://www.raspberrypi.org/forums/viewtopic.php?t=204778