1

I'm having the following error when archiving (running on device works great).

clang: error: '-I-' not supported, please use -iquote instead
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I'm using Apple LLVM compiler 3.1, and the cocos2d library (which seems to compile well). I also could archive until I added the cocos2d library.

When looking at the log navigator, I see that everything compiled well until it comes down to my project's source, each source file is throwing a clang error.

I've tried the following solution without success: Xcode 4 - clang error After changing the compiler to LLVM-GCC and setting my Header Search Paths, I still have the -I- specified twice errors. Also, the code stops running on the device since I entirely rely on ARC.

I would like to know what are the possible solutions to my problem. If I should try to build cocos2d independently, or if there are some compilation settings i can tweak.

Thank you for your help, and sorry in advance if I forgot some details or made a mistake, I'm relatively new to IOS dev

ps: using Xcode 4.3.2

Community
  • 1
  • 1
kyrj
  • 11
  • 1
  • I have the same problem but I don't have cocos2d in my app. You can see the Q&A here. It may help. http://stackoverflow.com/questions/8301649/xcode-4-clang-error – Tuyen Nguyen Apr 16 '12 at 23:27
  • Thank you for your answer, however, as I said, I already tried the solution, and since I am relying on ARC, my code doesn't compile with LLVM-GCC. I could try to modify the code, but since I have been working on this project since nearly a month, it would be much preferable to keep the current compiler. – kyrj Apr 17 '12 at 14:14
  • I think the problem is Cocos2D because this library doesn't use ARC as far as I know. – Tuyen Nguyen Apr 17 '12 at 16:16
  • True, therefore when compiling the library, I use apple LLVM compiler, with _objective-c_ _automatic_ _reference_ counting set to "NO", and in my project, it is set to "YES". The project do run. Tested on iPad (5.1), iPhone (5.1), iPod (4.2) – kyrj Apr 17 '12 at 16:31
  • Also, I am pretty sure the problem is related to cocos2d library, still, when archiving, the errors are thrown when compiling my code, and cocos2d libraries compile perfectly well. – kyrj Apr 17 '12 at 16:43

1 Answers1

0

After spending several days on this issue, I finally resign to downgrade my code from using ARC to not using it. I can now successfully create the archive.

The problem is that I now have to spend several hours taking care of memory management, and since the project was versioned (with several branches) for the purpose of parallel programming, this is surely going to stop our activity for a while.

If anyone finds a way to keep using the LLVM compiler, please let me know, this sort of information will always be useful.

kyrj
  • 11
  • 1