views:

2009

answers:

1

When I switch the Compiler Version to Clang llvm 1.0 in existing projects I get the following build error when Precompiling the *.pch file:

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

Is there another setting I need to change to get my project to work with the new compiler?

(I did try a clean all targets)


Update:

To clarify:

Since the new compiler does in fact work with new projects, the issue is not that my system is missing anything.

Additionally, Xcode should not even be trying to find llvm-gcc-4.2 as the whole point is that I switched from that compiler to the new one, Clang llvm 1.0. This is what has led me to believe there is still another setting to be changed.


Thanks to fbereto for his suggestion. The actual answer lies in the comments.

+5  A: 

If you look in path specified by the error you will not find an LLVM compiler (llvm-gcc-4.2) for the iPhone device:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/

That being said one does exist for the iPhone Simulator:

/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/

All this to say that while it may be possible to compile your iPhone App under LLVM for the Simulator, no equivalent tool exists for the device itself.

(Answer detailed in comments below.)

fbrereto
There is no problem with new projects, they work fine and do indeed "have all of the right files". In fact, it shouldn't be looking for gcc at all, just the Clang llvm compiler.This is only a problem with existing projects when I try to change the compiler.
Corey Floyd
To add: I can't say why the old legacy gcc compiler would not be in the folder, but shouldn't be affecting the issue (I would think).
Corey Floyd
Have you tried doing a diff of the xcodeproject between the old and new projects? Perhaps there would be a clue in there as to why the compiler settings differ between the two.
fbrereto
You were right, I found a clue. A diff revealed the only thing different was the ROOTSDK (BaseSDK), which was 3.0 instead of 3.1. I changed it and it worked. Odd that the BaseSDK still produces an error even though I was building against 3.1. Thanks! (SO won't let me up-vote you unless you edit your answer)
Corey Floyd
No sweat :)
fbrereto
So will this change the iPhoneOS compiler to LLVM, too? So would I get optimized code when I set the BaseSDK to iPhoneSimulator3.1 and the compiler to LLVM-GCC or LLVM-Clang? I'm asking because http://stackoverflow.com/questions/1525510/changing-to-llvm-compiler-when-deploying-iphone-app says not so.
MrMage