views:

660

answers:

2

OS X 10.5.6, Xcode 3.1 with iPhone support.

After compiling some apps for iPhone device in Xcode, I've noticed that calling GCC from command line no longer works:

$ gcc
gcc-4.0: installation problem, cannot exec '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin//i686-apple-darwin9-gcc-4.0.1': No such file or directory

Note how gcc attempts to launch i686 executable in iPhoneOS (arm) platform directory.

How do I switch back to MacOSX.platform toolchain?

$ ls /Developer/Platforms/
MacOSX.platform          iPhoneOS.platform        iPhoneSimulator.platform
+2  A: 

I'd start by checking your environment. I suspect you've exported a variable to set your platform directory at some point (particularly noting the double-slash in the path name). Check PATH and CC in particular, but I'd look for anything with /Developer in it. This looks like the kind of setting that comes in from some of the third-party build helpers and toolchains.

Rob Napier
Indeed, I've had `/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/` manually added to path. Silly me.
Alexander Gladysh
+1  A: 

start with the command:

which gcc

This will tell you the actual location of the gcc executable being called. You can then modify your PATH accordingly. You may also need to modify your LD_LIBRARY_PATH variable as well as the iPhone version is likely calling different runtime libraries as well.

Stinomus