Reputation: 70
I have an iOS app, which use liblzma. I am currently able to successfully write cross platform compile script to compile the source code into a .a file, and use the .a with headers in my project.
Now in iOS 8 and above, Apple start to support dynamic linking, so I was curious to see if I am able to use liblzma.dylib in my project instead of liblzma.a. But I failed.
Here's what I have done:
modify the compile script I previously used to compile liblzma.a. I changed --disable-shared to --enable-shared, and then use lipo to combine .dylib of each arch to a fat .dylib.
I removed the liblzma.a from my project, and added liblzma.dylib to my project
Build, success. But when running on device, I encountered the following error
dyld: Library not loaded: /Volumes/Data/Developer/build/xz-5.2.2/build/iOS/arm64/lib/liblzma.5.dylib Referenced from: /var/containers/Bundle/Application/AB7A063F-9C3F-4CEB-A757-965238947000/****.app/**** Reason: Incompatible library version:**** requires version 8.0.0 or later, but liblzma.5.dylib provides version 6.0.0 (lldb)
/Volumes/Data/Developer/build/xz-5.2.2/build/iOS/Universal/lib/liblzma.5.dylib: /Volumes/Data/Developer/build/xz-5.2.2/build/iOS/x86_64/lib/liblzma.5.dylib (compatibility version 8.0.0, current version 8.2.0) /usr/lib/libSystem.dylib (compatibility version 1.0.0, current version 1226.10.1)
I have a few questions:
Thanks!
Upvotes: 0
Views: 2069
Reputation: 70
Solved!
Upvotes: 0