Building Raspberry Pi programs on a traditional PC

Lead Image © pilart, 123RF.com

Cross wise

The Raspberry Pi is a smart little machine, but you might find it easier to write programs on another computer then copy them to the Raspberry Pi afterwards.

The Raspberry Pi is an excellent computer for hobbyists, but the Pi is not well suited for some CPU-intensive tasks. Compiling software, for example, can take hours even on a high-performing system. If you write your own software for the Raspberry Pi, you may be wondering if it is possible to develop and prepare code on a faster desktop computer and still use it later on the Pi.

The answer is, yes, you can, but the complexity of the task depends greatly on the programming language you are using. This article describes some of the steps you'll need to take for cross-coding with different languages.

As you will learn, the most popular and best-performing languages, such as C and C++, take the most effort because they require a compiler. The problem with compiling a Pi program on an ordinary desktop computer is that most desktop systems (including most Linux home computers, Windows systems, and recent-era Macs) have a CPU based on the Intel x86 chip family, and the Raspberry Pi CPU runs on an ARM chip. You'll need to become familiar with cross-compilers if you want to compile code on one hardware architecture then get it to run on a different architecture.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content