Alexander Gladysh
Alexander Gladysh

Reputation: 41393

OS X gcc "installation problem"

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

Upvotes: 0

Views: 1330

Answers (3)

Glen Yates
Glen Yates

Reputation: 159

I know this is an ancient question, but just in case someone runs into the same problem I did, you can also get this error:

c++: installation problem, cannot exec 'cc1plus': No such file or directory

If you are trying to cross-compile i386 code on a PPC machine and you have gcc 3.3 selected. To fix this, use gcc_select to select gcc 4.0 or greater. i.e. 'sudo gcc_select 4.0'.

Upvotes: 2

Jezzletek
Jezzletek

Reputation: 113

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.

Upvotes: 1

Rob Napier
Rob Napier

Reputation: 299345

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.

Upvotes: 2

Related Questions