Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 4, 2013, 05: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, 06:18 PM   #2
gnasher729
In Time-Out
 
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, 06: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, 06: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, 07:37 PM   #5
ArtOfWarfare
macrumors 603
 
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, 12:01 PM   #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, 12:04 PM   #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

Similar Threads
thread Thread Starter Forum Replies Last Post
Black screen , HDMI doesn't work , VGA doesn't work Madridista Mac Basics and Help 4 Jun 23, 2014 06:45 PM
My first applescript doesn't work. Please help. jbmoore Mac Programming 4 Sep 15, 2013 05:17 PM
VPN by iPhone work but at MacBook doesn't work! why ? Jingol Mac Basics and Help 1 Sep 12, 2013 05:40 PM
iPhone: Livewire doesn't seem to work for me... billyker Jailbreaks and iOS Hacks 4 May 10, 2013 07:10 AM
iPhone doesn't work masnij iPhone Tips, Help and Troubleshooting 7 Mar 6, 2013 05:20 AM

Forum Jump

All times are GMT -5. The time now is 08:36 AM.

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

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