11

The Project build & runs fine on a real device but a build for the iphone simulator finishes in this error 'llvm-gcc-4.2: error'. Any ideas?

llvm-gcc-4.2: error trying to exec '/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/../llvm-gcc-4.2/bin/arm-apple-darwin10-llvm-gcc-4.2': execvp: No such file or directory 
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 255

thx, Fabian

fmo
  • 818
  • 1
  • 8
  • 16

6 Answers6

9

### XCode < 4.3.2 ###

After updating XCode from 4.2 to 4.3, I had exactly the same issue with lots of "unrelated" errors:

make[1]: /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2: No such file or directory

Including a Command /Developer/usr/bin/clang failed with exit code 1 error.

I fixed that with:

cd /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
ln -s llvm-gcc-4.2 gcc-4.2

### XCode >= 4.3.2 < 5.0 ###

After updating XCode to 4.3.2 and since it's now an App (not in /Developer anymore). Need to do these steps for both the simulator and the iOS device:

Fix the issue on the simulator:

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
ln -s ../llvm-gcc-4.2/bin/llvm-gcc-4.2 gcc
ln -s ../llvm-gcc-4.2/bin/llvm-gcc-4.2 gcc-4.2

Fix the issue on iOS devices:

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
ln -s ../llvm-gcc-4.2/bin/llvm-gcc-4.2 gcc
ln -s ../llvm-gcc-4.2/bin/llvm-gcc-4.2 gcc-4.2

### XCode >= 5.0 ### (11/03/2014)

Fix the issue on the simulator:

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin
ln -s /usr/bin/llvm-gcc gcc-4.2

Fix the issue on iOS devices:

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
ln -s /usr/bin/llvm-gcc gcc-4.2
Stanley Ko
  • 3,383
  • 3
  • 34
  • 60
lucasart
  • 1,643
  • 1
  • 20
  • 29
  • 1
    how can you point llvm compiler to gcc compiler. both are different. isn't it? – Satyam Jun 01 '12 at 05:28
  • Satyam, see this discussion for more info on GCC vs. LLVM-GCC: http://stackoverflow.com/questions/4589335/llvm-vs-gcc-for-ios-development – lucasart Dec 08 '13 at 02:57
6

The first thing to do when things don't make sense is to clean the project (Product/Clean).

Also, look in /Developer/Platforms/iPhoneSimulator.platform ... etc and see if there is a directory or alias missing. Also open your target Build Settings and verify the paths under Search Paths.

Here's what my /Developer/Platforms/ looks like. /Developer/Platforms/...

Rayfleck
  • 12,116
  • 8
  • 48
  • 74
3

If you were like me you are upgrading a project.

Change your arch to arm7, which is now the standard I guess.enter image description here

James
  • 1,553
  • 2
  • 11
  • 13
1

You need to change the architecture to 'armv7' or 'armv6 armv7' and change the compiler for C/C++/Objective-C from LLVM GCC4.2 to Apple LLVM.

TommyV
  • 11
  • 1
1

For the owner of this question, issue might have been resolved already but for people who're still stuck with this. This error is mostly seem subjective to OSX Lion and XCODE 4.1, to fix it simply install Kenneth Reitz, OSX-GCC-Installer package and follow the instructions. You'll be good to go. Following link, might help. http://waqasshabbir.tumblr.com/post/19073648382/llvm-gcc-4-2-exe-error-on-mac-osx-lion-when-building

0

You're using the wrong architectures setting in Xcode. Please make sure that your app's target architectures is Optimized(armv7) or standard(armv6 armv7).