5

Just installed new version XCode 4.2 onto my Mac. I tried compiling my project but got the following error:

Unsupported compiler 'GCC 4.2' selected for architecture 'armv7'

Tried selecting arm7 in drop down for architechture in project and target settings. (The list actually shows just arm 7) still no use.

Please help.

Thanks

iOSDev
  • 3,617
  • 10
  • 51
  • 91

4 Answers4

16

you should actually select the LLVM compiler under "Compiler Version" instead of trying to set "Valid Architectures"

Saurabh Passolia
  • 8,099
  • 1
  • 26
  • 41
  • this might have happened if you are opening your older version (<4.2 SDK) of project in iOS SDK 4.2 – Saurabh Passolia Dec 16 '11 at 06:08
  • 1
    I found that I needed to actually select the LLVM option - as opposed to leaving it as 'Default compiler...', even when the default compiler _was_ the same LLVM option. (XCode 4.2) – iforce2d Mar 21 '12 at 18:26
  • haha.... I must be getting old. I'm back here again and find the answer to my question was previously posted by myself. This site rocks!! – iforce2d May 12 '12 at 23:31
8

xcode build errors:

Unsupported compiler ‘GCC 4.2′ selected for architecture ‘i386′

Solution:

This can be caused by importing a project for a pre- iOS 5 SDK into a copy of xcode with iOS 5 SDK only.

To fix, click your

Project -> Build Settings.  

Then under Build Options, there is an entry for Compiler for C/C++/Objective-C. Choose Apple LLVM compiler 3.0.

There is a chance this could effect other aspects of your binaries as you are using a new compiler, so YMMV. That being said, it’s so far caused no issues for me.

anoopelias
  • 9,240
  • 7
  • 26
  • 39
sinh99
  • 3,909
  • 32
  • 32
6

If you have multiple projects included within a single xCode project, go to editor>Validate project settings. This will set the compiler to LLVM 5.0 even if you don't see that option normally

Alex Stone
  • 46,408
  • 55
  • 231
  • 407
5

Go to BuildSettings->BuildOptions->CompilerFor c/c++/Objective C and change that to LLVM GCC 4.2 from 'Unsupported Compiler GCC4.2'