2
votes

I have a fat static library compiled for armv7 and i386. In my iPhone/iPad project everything works fine, but i can only install my application on armv7 device so iPhone 3gs and up...

There is a way to run my project on armv6 so i can install it on an ipod touch and an old iphone version (also if i disable the use of armv7 library).

I try this:

#ifdef _ARM_ARCH_7
... //include and use of armv7 library
#else
... //not include armv7 library
#endif

but when i compile my project i have link error...

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang++ failed with exit code 1

So there is a way to run my app on all kind of device but link a specific library when compiling for armv7???

Thanks for help!

1
how are you including the static library in your project today? Are you using -l (e.g. -l libmyFatLibrary) in the project settings or did you drag the static library into the file list of libraries & frameworks to be linked?Michael Dautermann
i drag the fat library in the file list... and work fine. I try with -l option?Luciano Salemme

1 Answers

2
votes

You need to weak-link that library. Open up build settings and find Other Linker Flags. You need to add two entries, the first is "-weak_library", the second is the path of the library file (you may need to hunt through what's being passed to the linker to find what this is).

They need to be in that order as this list is turned into parameters to the linker in the order they're presented.