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

scan

macrumors 6502
Original poster
Oct 24, 2005
344
0
I heard from someone that there is programming software on the OS X disc. I need something to compile C code. What am I looking for?
 

maxvamp

macrumors 6502a
Sep 26, 2002
600
1
Somewhere out there
Install XCode

You'll find GCC that will be able to compile your code for you.

Without more about what you are trying to do, I can't help you any further.

Max.
 

scan

macrumors 6502
Original poster
Oct 24, 2005
344
0
thats all I want to do. is compile C Code. i have a program that is written in C and I want to test it out. Question is: How?

maxvamp said:
You'll find GCC that will be able to compile your code for you.

Without more about what you are trying to do, I can't help you any further.

Max.
 

satans_banjo

macrumors regular
Sep 12, 2005
218
0
SE London
use this:

1. save your file
2. open terminal
3. cd into the directory your file is in
4. type the following into terminal, replacing <filename> with your filename:

gcc <filename>.c -o <filename>

or for C++ files:

g++ <filename>.cpp -o <filename>

the bit after the -o is the name the compilation will be named
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
GCC won't work unless you've installed Xcode already, or a separate version of GCC. Just use the Xcode install that comes with your OS X CDs.
 

scan

macrumors 6502
Original poster
Oct 24, 2005
344
0
kainjow said:
GCC won't work unless you've installed Xcode already, or a separate version of GCC. Just use the Xcode install that comes with your OS X CDs.


I did that and everthing works perfectly. I'm loving OS X more and more everyday. would never find any compilers on Windows
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.