Objective-c compiler

Hi!

I've instaled Xcode 3.1.2.
I'm trying to compile a small program in in objective-c using terminal. When I type the command to use it, I get an error "gcc: mycode.m: Objective-C compiler not installed on this system".

Why?

Thks

PB G4 12", Mac OS X (10.5.3)

Posted on May 11, 2009 2:43 PM

Reply
8 replies

May 11, 2009 3:34 PM in response to Perdo

What happens when gcc is called from Xcode? E.g. start a new project in Xcode using the Cocoa Application template (File->New Project->Mac OS X->Application->Cocoa Application), then open the Debugger Console window (Run->Console), then click "Build and Go" in the tool bar of any window. Let us know if the project builds and runs, or paste the contents of the Console for us here, ok?

p.s.: Please let us know where you got Xcode 3.1.2. From a CD? If a download, paste the url here too. Do you remember deselecting any installation options (e.g. Darwin?).

Message was edited by: RayNewbie

May 11, 2009 8:07 PM in response to Perdo

Well if Xcode was able to build and run that template we know the Obj-C compiler is installed somewhere. It would appear that Xcode can find it, but gcc can't. That points to an installation problem. Did you have any other dev tools installed prior to installing Xcode 3.1.2? Installing over a previous version requires cleaning out as much of the old dev tools as you can. For that reason I don't want to ask you to re-install 3.1.2 unless it seems really necessary.

I don't know how gcc finds its components. We have 2 or 3 developers around here who would know (e.g. eric meyers), and I hope one of them will take a look at this thread. For now the only thing I can think to check is your Terminal PATH environment variable. This is mine:
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:.

Type 'echo $PATH' or 'printenv' and see if your path is the same (ignore the colon-dot at the end; I put that there).

gcc might have a config file somewhere. I'll do a little research as soon as I can, but I'm hoping one of the guys I mentioned will stop by before that. Can you do your work from Xcode for awhile? The source editor is way cool. Just use the Foundation Tool template (File->New Project->Mac OS X->Command Line Utility->Foundation Tool).

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Objective-c compiler

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.