Accatyyc
Accatyyc

Reputation: 5828

XCode can't find GCC

After i updated iPhone SDK to 4.1 I can no longer compile neither for Simulator or Device. I get the following message:

error: can't exec '/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2' (No such file or directory)

Solution for this?

Upvotes: 2

Views: 2809

Answers (3)

Rob
Rob

Reputation: 4434

I had this happen to me. So for xcode 3.2.5:

  1. gcc-4.2 is definitely installed by the installer. ie:

    ls /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g* =>

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.0
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2
  1. Randomly linking in the gcc-4.2 from the /usr/bin directory is just asking for trouble. That's not the gcc that is part of the xcode package - who knows if it is really the same version.
  2. Reinstalling fixed it for me, although I was finding that particular install flakey.

Upvotes: 1

Accatyyc
Accatyyc

Reputation: 5828

I solved this by doing:

sudo cp /usr/bin/gcc-4.2 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2

Upvotes: 2

Peter DeWeese
Peter DeWeese

Reputation: 18333

Check to see if it is there and accessible, sudo ls -l /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2. Mine has these permissions: -rwxr-xr-x 1 root wheel 166128 Jul 26 15:05 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2

Have you tried reinstalling yet?

Upvotes: 2

Related Questions