0

I have a static library (very simple, no includes) which builds fine with "-arch i386", I can use the demo method in this library and everything is fine. As usual I have an .a file to link in my project.

Unfortunately I want to use this library in an iOS project, so when I use the iPhone Simulator everything is fine with the library built with "-arch i386" (because this is the processor the simulator uses). If I now want to build the library with "-arch armv7" (or "-arch armv6") for my ARM-based iPhone device I get in Eclipse and in Xcode the same error message: (in Xcode:) llvm-gcc-4.2 failed with exit code 255. Same exit code in Eclipse (255). With "i386" everything works.

Must I install anything in addition to my Xcode 4.2.1 on OSX Lion to make compile the lib for my ARM-Device?

Marc Schlösser
  • 751
  • 2
  • 8
  • 17
  • 1
    There must be more than just the exit code - check the output before that error message. – Till Dec 07 '11 at 19:42
  • Unfortunately not. only "returns 255". 255 could be a "catch all" message, I did not found a list with the gcc error codes. – Marc Schlösser Dec 07 '11 at 20:26

1 Answers1

0

The issue lies in the fact that Xcode 4 builds static libraries for each build rather than one unified universal build. So my guess is that you are just adding the build for debug-simulator and not for debug-device. Your best bet, add a script to your static library to build them all into one.

This post here on SO saved my life. Hopefully it will help you too.

Community
  • 1
  • 1
Bill Burgess
  • 14,054
  • 6
  • 49
  • 86