How can I combine object files (.o) to create a static library (.a) for iOS?

I have compiled the library and there are object files (.o). Now I want to combine them in a static library using ar. I can do this, but when I add this file to the iOS project, it says the library is an archive type and the architecture linking is arm7. How do I get around this?


ar -crs libstatic.a * .o I used to use ar from the iOS SDK and I think this is why it was failing.


source to share

2 answers

The best resource I've found on this topic is here:

It is a lengthy process, but every step is required for this to work as expected.



ar -rcs libexample.a *.o


Link the library to the switch:





All Articles