2

I typically write Linux and QNX command-line applications in VIM, generally steer away from graphical IDEs. I am currently working on a simple GUI-based application for the RPI that presents a text field for entering commands, and a read-only text field for displaying logging statements.

Is there a de facto standard means of setting up a build environment in Linux (ie: Ubuntu) so I can compile for ARM on the RPI and just deploy the binaries via NFS/SSH?

Additionally, is there a standard means of creating a staging area (ie: a bare-bones empty QT project with a makefile in place that already knows that the only valid target is to use the x86 compiler targeted for ARM)?

The end goal is to set up a few virtual machines with a bunch of empty/blank sample projects that will just build via the command-line when executing make.

I have read through other similar questions I found on SO, but they deal solely with installing the compiler. I also need to figure out how to set up a sample makefile project.

Thank you.


References

  1. Cross-Compiling for RaspBerry Pi
  2. Cross-compilation for Raspberry Pi in GCC. Where to start?
Community
  • 1
  • 1
Cloud
  • 18,753
  • 15
  • 79
  • 153

2 Answers2

3

This is covered in an answer to a similar question of yours.

Cross compiling for Raspberry PI

As for a staging area, no. You just need to cleverly write your makefiles so you don't clobber your existing OS installation.

Community
  • 1
  • 1
1

The trick is to link your QT4 application source (written on the PC) with QT4 libraries (on the RPi) compiled for Raspberry Pi/Raspbian OS.

To summarize:

  1. Install the RPi's cross compiling toolchain on your PC.
  2. Install the QT4 libraries on the Raspberry Pi/Raspbian OS.
  3. Mount the RPi's root file system onto your PC.
  4. Write a makefile that uses the RPi's cross compiling toolchain to build the QT source and link it to the ARM11 / Raspbian specific QT4 libraries (available on the mounted RPi filesystem) to create an ARM11/Raspbian binary.

The makefile must also use the moc-qt4 tool to generate necessary boilerplate code...one .moc.cpp for every .h header file containing a QT class declaration.

For a more detailed procedure : http://hertaville.com/2014/04/12/cross-compiling-qt4-app/

halherta
  • 31
  • 3