I would like to compile some code on the Raspberry PI, what is the best way to do this? I'm using Arch Linux, I checked and with the pacman I can only install gcc 4.6. Do I need a cross compiler?
Asked
Active
Viewed 867 times
6
-
Are you interested in compiling on the Pi for the Pi? Or on a PC for the Pi? – Alex Chamberlain Jul 21 '12 at 08:34
-
To compiling on the PI for the PI – Mokus Jul 21 '12 at 08:38
1 Answers
6
Cross-compilation is the process of compiling code for use on one platform on another platform. For example, you can compile software for the Raspberry Pi on a desktop (x86).
In your case, you want to compile software for the Raspberry Pi on the Raspberry Pi - this is normal. Just install gcc and use it as you would on a normal computer. It will default to the same architecture on which it is run.
gcc is a C compiler.
g++ is a C++ compiler.
Alex Chamberlain
- 15,530
- 14
- 67
- 113