static arm64 iOS library does not link in a tvOS project

陌路散爱 提交于 2020-01-06 03:25:26

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!