6

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?

tlhIngan
3,3725 gold badges21 silver badges33 bronze badges
asked Jul 21, 2012 at 8:22
2
  • Are you interested in compiling on the Pi for the Pi? Or on a PC for the Pi? Commented Jul 21, 2012 at 8:34
  • To compiling on the PI for the PI Commented Jul 21, 2012 at 8:38

1 Answer 1

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.

answered Jul 21, 2012 at 8:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.