Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 4, 2007, 09:23 PM   #1
andrewface
macrumors regular
 
Join Date: May 2006
im taking a c programming intro course...need a c compiler

whats a good c compiler for mac? i need it for my course...any suggestions

xcode do the trick?
__________________
2011 MBP i7 4Gb Ram
andrewface is offline   0 Reply With Quote
Old Jan 4, 2007, 09:24 PM   #2
Kodex
macrumors member
 
Join Date: Jan 2003
Xcode has your back it is a fully functional and free C complier. If you are feeling a bit confident you can also use the terminal and gcc
__________________
Any tips/soultions/advice that I give should be double checked with an Apple Certified Tech. I take no accountabilty for lost data or further issues.
Kodex is offline   0 Reply With Quote
Old Jan 4, 2007, 10:01 PM   #3
andrewface
Thread Starter
macrumors regular
 
Join Date: May 2006
Quote:
Originally Posted by Kodex View Post
Xcode has your back it is a fully functional and free C complier. If you are feeling a bit confident you can also use the terminal and gcc
cool where can i get xcode? or how do i install it i guess?
__________________
2011 MBP i7 4Gb Ram
andrewface is offline   0 Reply With Quote
Old Jan 4, 2007, 10:11 PM   #4
MisterMe
macrumors G4
 
Join Date: Jul 2002
Location: USA
Quote:
Originally Posted by andrewface View Post
cool where can i get xcode? or how do i install it i guess?
Xcode ships with every Mac and every copy of MacOS X. If it were not preinstalled on your computer, then it can be installed using the System Restore or Developer Tools disc. The latest version is a free download from the Apple Developer Connection website.
__________________
Neither a borrower nor a lender be
For loan oft loses both itself and friend
William Shakespeare from Hamlet
MisterMe is offline   0 Reply With Quote
Old Jan 4, 2007, 10:51 PM   #5
fivetoadsloth
macrumors 65816
 
fivetoadsloth's Avatar
 
Join Date: Aug 2006
Yes Xcode is a very good compliler and comes on the cds you got with your mac.
fivetoadsloth is offline   0 Reply With Quote
Old Jan 4, 2007, 11:42 PM   #6
superbovine
macrumors 68030
 
superbovine's Avatar
 
Join Date: Nov 2003
Quote:
Originally Posted by andrewface View Post
whats a good c compiler for mac? i need it for my course...any suggestions

xcode do the trick?
before you turn in you homework you should compile and test it on whatever specification your prof sets out. if you projects get large enough, you end of losing dev to time to fixing the difference between compile rather than completing you project. for a newbie might be best to start on the system the your case is setup.
superbovine is offline   0 Reply With Quote
Old Jan 5, 2007, 12:09 AM   #7
iancapable
macrumors 6502
 
Join Date: Oct 2006
Location: London, United Kingdom
Quote:
Originally Posted by andrewface View Post
whats a good c compiler for mac? i need it for my course...any suggestions

xcode do the trick?
What's wrong with GCC?

If you are after a C compiler, use the developer tools, or better yet install GCC (GNU Compiler Collection).

Srsly
iancapable is offline   0 Reply With Quote
Old Jan 5, 2007, 12:17 AM   #8
superbovine
macrumors 68030
 
superbovine's Avatar
 
Join Date: Nov 2003
Quote:
Originally Posted by iancapable View Post
What's wrong with GCC?

If you are after a C compiler, use the developer tools, or better yet install GCC (GNU Compiler Collection).

Srsly
considering xcode uses gcc...
superbovine is offline   0 Reply With Quote
Old Jan 5, 2007, 02:16 AM   #9
MacFan26
macrumors 65816
 
MacFan26's Avatar
 
Join Date: Jan 2003
Location: San Jose, California
Send a message via Yahoo to MacFan26
Quote:
Originally Posted by superbovine View Post
considering xcode uses gcc...
Yeah, that should be fine for whatever you need for your course, as long as you keep in mind that not all gcc commands are supported in OS X, but you probably won't have any problems with that. I just use it with terminal instead of Xcode.
__________________
15" i7 MacBook Pro antiglare, iPhone 4, 5G black iPod 60GB, iPod shuffle (red), new AppleTV
MacFan26 is offline   0 Reply With Quote
Old Jan 5, 2007, 02:47 AM   #10
hopejr
macrumors 6502
 
Join Date: Nov 2005
Location: New South Wales, Australia
Quote:
Originally Posted by MacFan26 View Post
Yeah, that should be fine for whatever you need for your course, as long as you keep in mind that not all gcc commands are supported in OS X, but you probably won't have any problems with that. I just use it with terminal instead of Xcode.
I agree, unless you need to write a cocoa or carbon app. If you need help on commands, just use the manual pages in the Terminal (man).

BTW, XCode isn't a compiler, it's an Integrated Development Environment. It uses GCC as the compiler as was stated earlier.

To use GCC in the terminal, just type:
gcc <c file name> -o <executable file name>
just like you would on any *n?x.

If you need to use make at all, that works too. So does gdb (XCode uses that for debugging).
__________________
Switched from Windows in August 2004...
MBP 15 2.6Ghz 4GB RAM 640 GB HDD, Lion
hopejr is offline   0 Reply With Quote
Old Jan 5, 2007, 07:44 AM   #11
andrewface
Thread Starter
macrumors regular
 
Join Date: May 2006
my prof was talking about how C is universal and can work with many operating systems...can i write windows programs in xcode? i think ill most likely have to hand in windows apps (uhg ****ing windows)...
__________________
2011 MBP i7 4Gb Ram
andrewface is offline   0 Reply With Quote
Old Jan 5, 2007, 08:44 AM   #12
pilotError
macrumors 68020
 
pilotError's Avatar
 
Join Date: Apr 2006
Location: Long Island
As long as your not creating visual elements (windows, dialog boxes, etc.) c-code is pretty generic and portable.

Talk to the professor and tell him your situation. I don't think they would force you to buy a windows PC just to compile.

He may want to run code on his own PC just to check though...

Mike...
pilotError is offline   0 Reply With Quote
Old Jan 5, 2007, 08:52 AM   #13
Swarmlord
Banned
 
Join Date: Sep 2006
Quote:
Originally Posted by pilotError View Post
As long as your not creating visual elements (windows, dialog boxes, etc.) c-code is pretty generic and portable.

Talk to the professor and tell him your situation. I don't think they would force you to buy a windows PC just to compile.

He may want to run code on his own PC just to check though...

Mike...
In fact a Windows PC should be the platform of last resort for a class on C. If I wasn't programming on my Mac, I'd be coding on somee flavor of Linux (and still be using gcc.) You could purchase a new Mac for what Microsoft will gouge you for some variety of .NET.
Swarmlord is offline   0 Reply With Quote
Old Jan 5, 2007, 09:19 PM   #14
superbovine
macrumors 68030
 
superbovine's Avatar
 
Join Date: Nov 2003
Quote:
Originally Posted by andrewface View Post
my prof was talking about how C is universal and can work with many operating systems...can i write windows programs in xcode? i think ill most likely have to hand in windows apps (uhg ****ing windows)...

lol!

even simple programs that use simple file i/o between windows/dos and *nix which includes os x cause problems.

you are going to be doing a lot of #ifdef if you are writing coding on multiple platforms. i maintained code for about a year that was 10 years old. The first ver was written for a sun sparc then pushed over to bsd then windows then linux then a mac. yeah a lot of the code was the same but there are alot #ifdef to make code specific to PPC or x86 for example.

a good example if you try to use a library to print an IP address from x86 linux and get the code to compile on a PPC running OS X the ip address will print backwards due the little endian on a PPC.
superbovine is offline   0 Reply With Quote
Old Jan 8, 2007, 12:06 AM   #15
iancapable
macrumors 6502
 
Join Date: Oct 2006
Location: London, United Kingdom
Quote:
Originally Posted by superbovine View Post
considering xcode uses gcc...
I hadn't thought about that actually!
iancapable is offline   0 Reply With Quote
Old Jan 8, 2007, 10:44 PM   #16
andrewface
Thread Starter
macrumors regular
 
Join Date: May 2006
so if all i need is a c compiler should i bother installing the whole xcode package or should i just install gcc 4.0?

i dont need the whole 2.4 gigs installed i wont use any of it?
__________________
2011 MBP i7 4Gb Ram
andrewface is offline   0 Reply With Quote
Old Jan 8, 2007, 10:55 PM   #17
andrewface
Thread Starter
macrumors regular
 
Join Date: May 2006
ok i installed the whole developers tools thing...when i first ran xcode it said new user...i exited the program...now it doesnt ask to set up new user...how do i set up a new user now?
__________________
2011 MBP i7 4Gb Ram

Last edited by andrewface; Jan 8, 2007 at 11:10 PM.
andrewface is offline   0 Reply With Quote
Old Jan 8, 2007, 11:30 PM   #18
bousozoku
Moderator emeritus
 
Join Date: Jun 2002
Location: Gone but not forgotten.
If I recall from running Xcode the first time, it asks a bit about how you want the main window and the project window set and where you want to put binaries and things like that. It's not a big deal.

You should at least try the Xcode editor, even if you're going to compile on the command line. It saves me from starting emacs.
bousozoku is offline   0 Reply With Quote
Old Jan 9, 2007, 04:37 AM   #19
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by superbovine View Post
a good example if you try to use a library to print an IP address from x86 linux and get the code to compile on a PPC running OS X the ip address will print backwards due the little endian on a PPC.
Only if the original programmer didn't know their stuff. Lookup "htonl" and "ntohl".
gnasher729 is offline   0 Reply With Quote
Old Jan 9, 2007, 07:41 AM   #20
pilotError
macrumors 68020
 
pilotError's Avatar
 
Join Date: Apr 2006
Location: Long Island
Quote:
Only if the original programmer didn't know their stuff. Lookup "htonl" and "ntohl".
LOL...

Was thinking the same thing but wouldn't say it.

We still push around 15+ year old c-code between platforms. Some of the stuff originated on VMS then to HP/UX or Sun and now to Linux. I love doing porting work. Getting old code that used to take an hour to do a task and having it run in like 4 minutes gives you a sense of accomplishment!
pilotError is offline   0 Reply With Quote
Old Jan 9, 2007, 08:07 AM   #21
colocolo
macrumors 6502
 
Join Date: Jan 2002
Location: Santiago, Chile
Andrew,

I dont think an intro course to C will require you to do Windows or any GUI-specific app.
Of course, I'm assuming its an introduction to programming in general and not just C, so probably you'll get only as far as using the stdin and stdout as your input/output.

If that's the case, you can write the programs in any environment you wish and it will work seamlessly.

BTW, did anyone else have to do their first programming course in college using scheme?
colocolo is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Im looking for a program hotwater10 Mac Applications and Mac App Store 4 Jan 13, 2010 07:52 PM
looking to take apple fcp training course need some advice rangerfreak1 Mac Applications and Mac App Store 1 Mar 26, 2009 09:43 AM
Help, im taking a trip to Italy... HC Penniwicket iPod 9 Mar 13, 2006 12:22 PM
What programs will I need. Im a convert. sammyman Mac Applications and Mac App Store 16 Mar 29, 2005 02:01 PM
Im taking the plunge but I have a few questions Patmian212 Buying Tips, Advice and Discussion (archive) 9 Feb 14, 2005 05:13 AM


All times are GMT -5. The time now is 06:29 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC