0

I want to make app for raspberry pi. I chosed gtk for gui library because it has a good looking ui and it is free. But i have 1 problem with it: i don't know how to export simple app that will work on raspberry pi. I have raspberry pi zero.

MN_XD
  • 7
  • 1
  • 4
  • Gtk should already work and be installed on your Raspberry Pi (it is on my Pi 4). Do you have any problems with running Gtk on a Raspberry Pi Zero? If so, please [edit] your question to contain them, so that we can help. – Sylvester Kruin Jan 26 '22 at 21:00
  • On my raspberry pi gtk works normally i was thinking that easier for me will be just make it on faster computer and somehow export my app, but i don't know how to do it – MN_XD Jan 27 '22 at 08:16
  • If the Pi Zero has a memory card slot or a USB port, you could just copy the code from one device to the other. Or you could email it to the Pi. I'm not quite sure what you mean by "exporting the app", and I don't use a Pi Zero, so I probably won't be much help here. – Sylvester Kruin Jan 27 '22 at 16:06
  • By exporting app i was meant "compiling" app. I could insert usb with code to the raspberry pi, but maybe there is other way of compiling it for raspberry pi on my computer. If there isn't any way of compiling it on my computer i can do it on raspberry pi. – MN_XD Jan 27 '22 at 17:33

2 Answers2

0

What you're trying to do is cross-compiling. In order to do that, you need to set up an appropriate toolchain. Here is the link to the relevant discussion on SO on how to achieve that.

That said, it might be more trouble than it's worth. I have 3 ARMs and I mount them locally via sshfs (fuse). That enables me to edit/develop as if the files were local to my system (i.e. using my ubuntu environment). I only compile remotely, via an ssh session.

Andrej Prsa
  • 551
  • 3
  • 14
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 02 '22 at 14:05
0

GNOME Builder supports automagic cross compiling when using flatpak (it is also really simple with cli flatpak-builder). It also supports adding extra sysroots for non-flatpak cross compilation.

But if you are using flatpak, you should install and setup deviced on the raspberry pi https://gitlab.gnome.org/chergert/deviced. And have qemu-user-static (usually named like that on distros) installed on the computer you are compiling on. Then you can simply select the device enter image description here, accept it on the raspberry pi, it will automatically download the SDK. Then click the run button and it will run on the raspberry pi.

Note that compilation will be quite slow as flatpak emulates a native arm compiler instead of using a compiler that compiles to arm, but the compiler itself is x86.

Teipekpohkl
  • 176
  • 2