Objective-C compiler not installed on this system

Joined
Mar 31, 2011
Messages
8
Reaction score
0
Points
1
When I try to compile code from the command line
(gcc -framework Foundation Prog1.m -o Prog1),
I receive the message that states Objective-c compiler is not installed. I installed the XCode from the Mac OS X cd, and upgraded to XCode 4.0.2.

I figure there is not a PATH set properly. Anyone have a clue?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Installing the development tools (Xcode) will install GCC, the appropriate libraries and will create symlinks where necessary. Execute the following to see what it returns (it should return /usr/bin/gcc):
Code:
whereis gcc
If that returns nothing, try reinstalling Xcode. Someone else here had an issue recently similar to yours and reinstalling fixed it.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
You should have all the appropriate tools. I just did it here with a simple hello world app and it worked perfectly fine (I'm using GCC 4.2.1). Have you tried reinstalling the dev tools? Have you tried compiling this through Xcode? Others have noted that compiling through Xcode works when it doesn't work doing it "manually" (by hand at the CLI).
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
I installed the XCode from the Mac OS X cd, and upgraded to XCode 4.0.2.

I figure there is not a PATH set properly. Anyone have a clue?

Could be. If you did the install, and haven't logged out since then, that may be the trick. That PATH gets setup during login. Yes, you can set it manually.
 
OP
R
Joined
Mar 31, 2011
Messages
8
Reaction score
0
Points
1
Still no luck

I reinstalled X Code 4.0.2. I can create a simple "Hello World" through X Code and it works. If I try to compile with a GCC command, I still get the message "Objective-C not installed. I have rebooted.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
is /Developer/usr/bin/ in your path?
 
OP
R
Joined
Mar 31, 2011
Messages
8
Reaction score
0
Points
1
Yup. Result of echo $PATH = /usr/local/gnat/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/X11/bin

Anybody have a path for a system that works?
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
well, here's mine. I don't see it as being hugely different.

Code:
mikeMbp:~ mike$ echo $PATH
/sw/bin:/sw/sbin:/Users/mike/scripts:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/ibm/dscli:/Developer/usr/bin/:/usr/X11R6/bin
mikeMbp:~ mike$
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
I've installed both 3.2 and 4.x of Xcode. Here is my path when in the tcsh and the whereis statement result for cc.


[mac:~] xstep% echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/mysql/bin

[mac:~] xstep% whereis cc
/usr/bin/cc
 
OP
R
Joined
Mar 31, 2011
Messages
8
Reaction score
0
Points
1
Thanks

Thanks to all who helped. The problem was in my path. Even though "whereis gcc" returned the correct gcc, "which gcc" follows the path and pointed to the gnat gcc. Once I corrected the path, it worked properly.
 
Joined
Jun 11, 2015
Messages
6
Reaction score
0
Points
1
Thanks to all who helped. The problem was in my path. Even though "whereis gcc" returned the correct gcc, "which gcc" follows the path and pointed to the gnat gcc. Once I corrected the path, it worked properly.

My "whereis gcc" shows the correct path where as "which gcc" does not. Please suggest how could I fix it
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
whereis will search a preset list of directories and which will only search your PATH. If whereis finds it and which doesn't, it sounds like the issue is simply that gcc is not located in your PATH. See here for more info.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top