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, 2013, 04:54 PM   #1
Mister V
macrumors newbie
 
Join Date: Jan 2013
gcc doesn't work

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
Mister V is offline   0 Reply With Quote
Old Jan 4, 2013, 05:18 PM   #2
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Xcode 4.5 is a free download from the App Store.

Any particular reason why you are trying to use gcc and not clang?
gnasher729 is offline   0 Reply With Quote
Old Jan 4, 2013, 05:20 PM   #3
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Mister V View Post
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
LPZ is offline   0 Reply With Quote
Old Jan 4, 2013, 05:24 PM   #4
Mister V
Thread Starter
macrumors newbie
 
Join Date: Jan 2013
I've already tried clang... :/
reason: OS X Mountain Lion and old version of xcode?
Mister V is offline   0 Reply With Quote
Old Jan 4, 2013, 06:37 PM   #5
ArtOfWarfare
macrumors 601
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
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.)
ArtOfWarfare is offline   0 Reply With Quote
Old Jan 6, 2013, 11:01 AM   #6
robvas
macrumors 68000
 
Join Date: Mar 2009
Location: USA
Quote:
Originally Posted by ArtOfWarfare View Post
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.)
They now have a download that's only 171MB instead of almost 2GB for all of XCode. It just includes the command-line tools.

http://kennethreitz.com/xcode-gcc-and-homebrew.html
robvas is offline   0 Reply With Quote
Old Jan 6, 2013, 11:04 AM   #7
balamw
Moderator
 
balamw's Avatar
 
Join Date: Aug 2005
Location: New England, USA
Silly me, I though that package required Xcode to be installed first. At least that's how I've used it.

B
__________________
MBA (13" 1.7 GHz 128GB), UMBP (15" SD 2.8 GHz), UMB (13" 2.4 GHz), iMac (17" Yonah), 32GB iPad 3 WiFi+LTE, 64 GB iPad WiFi, 32 GB iPhone 5, Airport Extreme
balamw 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


All times are GMT -5. The time now is 04:02 AM.

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

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