0

I have my application set up to use the LLVM GCC 4.2 in Target>Build Settings under Compiler Version and it worked for the simulator.

When I switched my "Scheme" to target an iPad, it threw the same warnings as I was getting when using GCC, so I'm assuming it is compiling under GCC now. But the "C/C++ Compiler Version" target is still set to LLVM GCC 4.2 (except under iOS Default, where it is GCC 4.2 and I cannot change).

Why is it not compiling with LLVM GCC anymore and how can I change it so it does under the iPad?

Edit: The error I was getting has to do with accessing a superclass's instance variable. GCC gives an error if you did not write it as [self iVarName] while LLVM GCC compiles fine if you just use iVarName.

AndrewKS
  • 3,603
  • 2
  • 24
  • 33
  • Did you clean this target? And can you give an example of an error you are trying to avoid this way? – Firoze Lafeer Apr 03 '11 at 01:16
  • I do believe I cleaned the target. The error had to do with referring to a superclass's instance variable. Added the error to my question. – AndrewKS Apr 03 '11 at 02:17
  • Are you running a 32-bit simulator by chance? My guess is you are using LLVM/GCC on the iPad, but remember the iPad uses the modern runtime. Sounds like your code is doing something that is not allowed on the modern runtime. Synthesizing a property using a superclass ivar perhaps? – Firoze Lafeer Apr 03 '11 at 04:47
  • I was using it exactly like this question and also solved it doing the same: http://stackoverflow.com/questions/3957288/why-does-a-subclass-property-with-no-corresponding-ivar-hide-superclass-ivars If the iPad was using LLVM/GCC, then I believe it would not get this error - but unfortunately it does. I'm not sure if I'm using a 32-bit simulator. I'll have to check on Monday when I am back at work. Is iPad 32-bit or 64? – AndrewKS Apr 03 '11 at 08:44
  • The iPad is 32-bit, however it uses the "modern" runtime like 64-bit Macs. My suggestion is post the actual code and error you are getting, and someone can solve that underlying issue. If, for example, you are trying to @synthesize a property in a subclass that is trying to wrap a superclass ivar, you can't do that directly in the modern runtime. – Firoze Lafeer Apr 03 '11 at 14:05
  • BTW, disregard what I said about the 32-bit sim. I was thinking about the pre-summer 2010 sim. Regardless, I think you should look at the underlying error here. I think the assumption that you just have the wrong compiler is probably not correct. – Firoze Lafeer Apr 03 '11 at 20:11

1 Answers1

-1

LLVM GCC is te LLVM preprocessor with the GCC compiler, so you should see the same error messages (and a few more in the IDE thanks to LLVM). You could try the LLVM Compiler 2.0, but it has a few bugs at the moment. To set the compiler, choose the project at the top left, tap the Build Settings tab and change the compiler.

Hiltmon
  • 1,265
  • 9
  • 6
  • "LLVM GCC is te LLVM preprocessor with the GCC compiler, so you should see the same error messages (and a few more in the IDE thanks to LLVM)." I don't... in fact LLVM GCC shows no errors that GCC does. And when I use the iPad device it throws the errors that GCC did that LLVM GCC did not, even though I set the compiler to LLVM GCC. Please read the question. – AndrewKS Mar 30 '11 at 21:33
  • 1
    it is the other way around. "LLVM GCC 4.2" is actually the GCC front end mated with the LLVM back end code generator. – Firoze Lafeer Apr 03 '11 at 01:20