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

Mister V

macrumors newbie
Original poster
Jan 4, 2013
2
0
Hi guys,

the problem which I am struggling with is that I wanna compile an objectiveC code via terminal and it doesn't work.

I have the Xcode 3 version but OS X Mountain Lion.

After entering the command

gcc -framework Foundation -fobjc-gc-only -o Program sourcecode.m

terminal says: bash:command gcc not found
 
Xcode 4.5 is a free download from the App Store.

Any particular reason why you are trying to use gcc and not clang?
 
Hi guys,

the problem which I am struggling with is that I wanna compile an objectiveC code via terminal and it doesn't work.

I have the Xcode 3 version but OS X Mountain Lion.

After entering the command

gcc -framework Foundation -fobjc-gc-only -o Program sourcecode.m

terminal says: bash:command gcc not found

What about

Code:
/usr/bin/gcc -framework Foundation -fobjc-gc-only -o Program sourcecode.m
 
I've already tried clang... :/
reason: OS X Mountain Lion and old version of xcode?
 
Download Xcode 4 from the App Store (it's free), then open preferences -> downloads and download & install the command line tools.

IDK of any other ways to install the command line tools (not that I've tried.)
 
Silly me, I though that package required Xcode to be installed first. At least that's how I've used it.

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