47

I have a project which contains Geos and Proj inside it. Before Xcode 5 I compiled them with LLVM GCC 4.2 compiler, but in Xcode 5 DP I get an error about unsupported compiler. Choosing another compiler get to compilation errors depends on syntax. How can I fix this trouble?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Azat
  • 6,745
  • 5
  • 31
  • 48

3 Answers3

234

Change your compiler for C/C++/Objective-C:

Xcode > Target > Build Settings > Build Options > Compiler for C/C++/Objective-C

Select Default compiler (Apple LLVM x.y)

pkamb
  • 33,281
  • 23
  • 160
  • 191
rizwan-ahmed
  • 2,341
  • 1
  • 11
  • 4
1

If you are compiling from the command line (like I do when building GEOS and proj4) The following command will find the correct compiler for you and run it.

xcrun --sdk iphoneos clang

Or use iphonesimulator instead of iphoneos if you want to build for the sim.

Aaron
  • 2,403
  • 1
  • 24
  • 25
  • do you add GEOS and proj4 as compiled static library? In my project they are attached as source code – Azat Jul 10 '13 at 04:59
-23

A) Stop using Xcode 5

or

B) Fix the errors in your code

I know you won't like that answer but Apple has stated their displeasure for GCC on many occasions and declared it a deprecated technology.

borrrden
  • 33,256
  • 8
  • 74
  • 109
  • 2
    @BraveS You mean the switching the compiler one? If you read the question, OP indicates that they tried that already and got errors. – borrrden Nov 01 '13 at 09:29
  • Sorry but this answer is useless. If I had the power, I'd remove it from the internets. – wallacer Nov 21 '13 at 07:34
  • @wallacer You got a better one? ;) Apparently OP was ok with it since they accepted it... – borrrden Nov 21 '13 at 08:17
  • @borrrden, (+) well done! all of those who voted to the other answer didn't read the question :) (still the other answer is the one that helped me...) – Yossi Nov 25 '13 at 20:20
  • 3
    @Yossi Indeed, the other answer is helpful to 99% of people, however the person who asked this question is one of the other 1% haha. – borrrden Nov 26 '13 at 01:26
  • You obviously have a lot of wisdom to share. Why stifle it with cynicism? – Jacksonkr Jun 20 '16 at 18:17
  • don't delete the answer please and also the conversation too. Because it is a good lesson for us . – Arun Jul 03 '17 at 09:06
  • @Spynet I have no intention to at this point (and so far I haven't been able to since it is accepted :p). I think I even got a medal for having so a low voted accepted answer. – borrrden Jul 03 '17 at 21:25
  • I hope you have mistaken me , even n number of down votes ( you didn't delete answer ), i really appreciate you are leaders for us. and also your the so glittering stars. – Arun Jul 05 '17 at 05:39