OS X gcc "installation problem"

OS X 10.5.6, Xcode 3.1 with iPhone support.

After compiling some iPhone device apps in Xcode, I noticed that calling GCC from the 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

      

Notice how gcc tries to run the i686 executable in the iPhoneOS platform directory (arm).

How do I switch back to the macOSX.platform programming chain?

$ ls /Developer/Platforms/
MacOSX.platform          iPhoneOS.platform        iPhoneSimulator.platform

      

0


a source to share


3 answers


I would start by checking your environment. I suspect you have exported a variable to set your platform directory at some point (especially noting the double slash in the path name). Check PATH and CC in particular, but I would like to find anything with / Developer in it. This is similar to the customization that comes from some third party assemblers and toolchains.



+2


a source


I know this is an ancient question, but just in case someone is facing the same problem as me, you might 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 selected gcc 3.3. To fix this, use gcc_select to select gcc 4.0 or higher. those. 'sudo gcc_select 4.0'

...

+2


a source


start with the command:

which gcc

This will tell you the actual location of the gcc executable. Then you can change your PATH. You may also need to change your LD_LIBRARY_PATH variable, and the iPhone version will probably call other runtime libraries as well.

+1


a source







All Articles