Solved compile and run c++ on raspberry pi

January 29, 2013 at 10:29:52
Specs: Windows XP
I am fairly new with the raspberry pi and c++ and was wondering how I could compile and run c++ files on the raspberry pi I have heard about but do not understand the term cross compiling I was wondering if anyone could help.

See More: compile and run c++ on raspberry pi

Report •

January 29, 2013 at 11:22:24
✔ Best Answer
You need a compiler that wwll run on a PC and generate code that will run on a strawberry.

Normally a C++ compiles code to run on the platform ii is being compiled on. A cross compiler generates code for a completely different platform and will not run on the platform it is being compiled on.

Wonderful tool Google. If you are going to leant anything about programming, how to use Google should be the first thing to learn


Report •

January 29, 2013 at 11:53:24
You could compile directly on the Pi. Easier than cross-compiling, but it will be a bit slower. But it's certainly feasible. I have a Gentoo installation on a Buffalo LinkStation, which is appreciably less powerful than a Pi.

With Gentoo you compile the whole system. It took a few days, but that's a huge amount of code. Simple C++ programs will compile with ease on the Pi.

I'm not sure if GCC is included in the standard Pi distributions. I'd be surprised if it isn't, but it's easily added if necessary. Here's an article about it:

Report •
Related Solutions

Ask Question