PhillyNJ
Posts: 112
Joined: Sat Dec 29, 2012 4:07 am

Programming C on the Raspberry Pi

Thu Mar 21, 2013 1:20 am

Hi,

I am a programmer by day. I know several high level languages like C#, Java and Objective C. It has become clear to me that I need to learn C. I would like to do my C learning/programming on the Pi and was wondering if anyone could provide some resources on C programming on the Pi. I am interested in learning how to Cross compile for ARM.

Thanks,

Phil

danjperron
Posts: 3624
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Programming C on the Raspberry Pi

Thu Mar 21, 2013 2:46 am

I'm using the latest debian on my mac using virtual box. You could do the same thing with Microsoft windows professional , by creating a virtual PC.

You could also use a full linux distribution . Create a bootable partition.

Or simply use cygwin !

For the cross compiler just follow one of these web pages.

http://www.kitware.com/blog/home/post/426
http://www.bootc.net/archives/2012/05/2 ... pberry-pi/

I'm on the opposite of you!
I started programming by entering binary code into ram using RCA 1802, assembler on 6502 , basic on the apple II and when to era of pc started, I learned C (osborne computer),followed by pascal, c++ and now is C# .


Daniel

bobblestiltskins
Posts: 16
Joined: Wed Aug 29, 2012 11:10 am

Re: Programming C on the Raspberry Pi

Thu Mar 21, 2013 10:56 am

Is there any reason why you want to cross-compile? You could use an ssh client from your desktop machine and use the native compiler on the pi?

If you install gcc (or clang) via "aptitude install gcc" or "aptitude install clang" then you can compile and run C programs natively.

danjperron
Posts: 3624
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Programming C on the Raspberry Pi

Thu Mar 21, 2013 11:34 am

All depends of the size of the program and compilation speed.

A very big program will be very very slow to compile. (Like Kernel).

Also you could use some nice GUI interface. ( I know that somes are available on the RPi also).

Daniel

PhillyNJ
Posts: 112
Joined: Sat Dec 29, 2012 4:07 am

Re: Programming C on the Raspberry Pi

Thu Mar 21, 2013 12:43 pm

Thanks All for the suggestions.

@ bobblestiltskins - I will most likely develop on my mac and compile of the Pi for ARM unless you have a better suggestion. - Thanks again

Return to “General programming discussion”