问题
I have a static fat library, which contains the architecture arm64, that can be linked in a project for iOS. However, when I try to use this library in a tvOS project I have the following link error:
"... building for tvOS, but linking in object file built for iOS, for architecture arm64"
I am not sure if I can reuse arm64 libraries, which work properly in iOS projects, in a tvOS project or perhaps I will have to create an arm64 library from a tvOS project (TV static library).
回答1:
For Xcode 7, object files and static libraries are marked with both the platform and the minimum version that they're designed for.
You'll have to build a separate library for each platform (and each platform target would need to link against the static library specifically built for that platform).
Trying to build a library that supports multiple platforms would run contrary to app thinning techniques such as slicing:
Slicing is the process of creating and delivering variants of the app bundle for different target devices. A variant contains only the executable architecture and resources that are needed for the target device.
来源:https://stackoverflow.com/questions/34509723/static-arm64-ios-library-does-not-link-in-a-tvos-project