1

I want to create a iOS project using c static libraries. I have downaloaded these files

ohNetGenerated-iOs-arm64-Debug.tar.gz

ohNetGenerated-iOs-arm64-Release.tar.gz

ohNetGenerated-iOs-armv7-Debug.tar.gz

ohNetGenerated-iOs-armv7-Release.tar.gz

ohNetGenerated-iOs-x86-Debug.tar.gz

ohNetGenerated-iOs-x86-Release.tar.gz

When I extract them they all have: libohNetGeneratedDevices.a

How can I generate a fat library? Is it possible

Thank you

3

1 Answer 1

1

Use lipo to create a fat library:

lipo -create armv7/libmylib.a arm64/libmylib.a x86/libmylib.a -output libfat.a

You can combine the versions of the library that are for different architectures in a fat library, but you can't combine versions of the library that are for the same architecture, so you can't combine the Release and Debug versions of the same architecture.

Sign up to request clarification or add additional context in comments.

4 Comments

Glad it works! Yes, you can use lipo -info libfat.a to see the architectures inside
Yes It also works!, I run the info and it says: Architectures in the fat file: ohNetDevicesFatDebug.a are: armv7 i386 arm64. The library has includes, any of them (if I just include arm64 for example) would work using the the libfat.a, isn't it?
Yes normally the header files are platform independent. Strictly speaking it's not necessarily the case as they can contain macros or inline functions that can contain inline assembly or compiler intrinsics specific for a platform. But it's a safe bet and if not you will find out during compilation
Thank you very much again! I would upvote you more times but i can't :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.