We no longer use this approach and this page may be out of date – it is left here for archive puropses. We now use NetBeans for C/C++ development on the RPi, see here.
Programming in C in the Raspberry Pi works great but tools such as geany are often sluggish to use due to RPi hardware limitations (the sluggishness of the geany editor dives us mad!). Programming on a more powerful PC solves this problem and allows more advanced IDE's to be used such as eclipse. The catch is that the Raspberry Pi is an arm based architecture whilst PC's are Intel based. The options then:
1. Install Raspbian or an another arm based linux distribution on your PC using a virtual machine.
The Pro's:
Your PC installation can use the exact same tools as the Raspberry Pi so there are no compatibility issues at all when compiling.
The Con's
You can only install programs such as IDE's ported to run on the ARM architecture.
2. Install a debian based Intel based OS on your PC (also in a virtual machine if preferred to using as your native OS) and use a cross compiling toolchain to convert between the Intel and ARM architectures.
The Pro's:
Install any IDE and tools without the limitation of only being able to run tools ported for the ARM architecture.
The Con's
<p margin-left:="" 120px;"=""> You need a cross compile toolchain and you'll may have to deal with library differences between the two architectures. Cross compilation of simple applications which only require the use of the standard C/C++ libraries included with the cross compiling toolchain is relatively straightforward. Cross compilation of more complicated applications that require external libraries however (e.g. GTK+), is typically complicated to setup. This may be solvable by setting your your compiler to use the files of the Raspberry Pi when compiling or by using other solutions, but basically there's hoops to jump through…
Using QMEU To Virtualise Raspbian Without Needing A Cross Compiler
http://raspberrypi.stackexchange.com/questions/165/emulation-on-a-linux-pc
Using A Linux PC or Linux VM On Windows With A Cross Compiler
http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
Developing In Windows
See our guide here.
2 years ago
http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
this link doesn’t work anymore??
10 years ago
I tried this step by step tutorial on how to install an Eclipse cross compile environment (in Debian wheezy in my case)
http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
Very well explained – I have never worked with Eclipse before and only occasionally use Linux – but got everything working in half a day.