静态 arm64 iOS 库未在 tvOS 项目中链接 [英] static arm64 iOS library does not link in a tvOS project

查看:27
本文介绍了静态 arm64 iOS 库未在 tvOS 项目中链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个静态胖库,其中包含架构 arm64,可以在 iOS 项目中链接.但是,当我尝试在 tvOS 项目中使用此库时,出现以下链接错误:

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"

我不确定是否可以重用在 iOS 项目、tvOS 项目中正常工作的 arm64 库,或者我可能必须从 tvOS 项目(电视静态库)创建 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).

推荐答案

对于 Xcode 7,目标文件和静态库都标有平台和它们设计的最低版本.

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.

这篇关于静态 arm64 iOS 库未在 tvOS 项目中链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆