Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Spanky Deluxe

macrumors demi-god
Original poster
Mar 17, 2005
5,282
1,745
London, UK
Forgive me for being stupid but how do I write simple command line programs in C in OS X? I think I can write programs in the text edit program and then compile them with 'make' but I'm sure there must be a simple program or way to use XCode so as to debug and spot errors. Something on the lines of the Salford C compiler in Windows.

Any help would be greatly appreciated!!
 

Catfish_Man

macrumors 68030
Sep 13, 2001
2,579
2
Portland, OR
I find Xcode is overkill for small stuff. A text editor + gcc + gdb is what I use; However, Xcode can handle C programs just fine. You just create a project of the right type (command line tool, iirc).
 

Spanky Deluxe

macrumors demi-god
Original poster
Mar 17, 2005
5,282
1,745
London, UK
Catfish_Man said:
I find Xcode is overkill for small stuff. A text editor + gcc + gdb is what I use; However, Xcode can handle C programs just fine. You just create a project of the right type (command line tool, iirc).

I just worked it out. You have to create a "Standard Tool" under the application type "Command Line Utility". I'm just starting a project full of equations and fitting algorythms and stuff. The kind of things where mistakes are easily made, so some level of debugging tools would be of great help. I'll give Xcode a try and see if it can do everything I want without being overcomplicated. :)

Thanks! :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.