本文介绍了Xcode 6.1:文件是为 x86_64 构建的,这不是被链接的架构 (i386)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为 util/extensions 创建了一个 Swift 框架项目,该项目编译并复制 .framework 文件到我系统上的专用位置.我希望能够将此文件包含到其他项目中(构建阶段/链接二进制与库).框架项目为Cocoa Touch Framework类型项目(从Xcode 6.1项目模板浏览器中选择).

I've created a Swift framework project for util/extensions that compiles and copies a .framework file to a dedicated location on my system. I want to be able to include this file into other projects (Build Phases/Link Binary with Libraries). The framework project is a Cocoa Touch Framework type project (as selected from Xcode 6.1 project template browser).

但是当我尝试编译链接框架文件的项目时,我收到此警告:

But when I try compiling a project which links the framework file, I'm getting this warning:

ld:警告:忽略文件/Users/name/Projects/Xcode/Libs/swiftutils.framework/swiftutils, 文件是为 x86_64 构建的,这不是被链接的架构(i386):/Users/name/Projects/Xcode/Libs/swiftutils.framework/swiftutils

我可以对框架项目做些什么以使其对其他 iOS 项目有效?这很令人困惑,因为框架项目是一个 Cocoa Touch Framework 项目,它应该自然地与其他 Cocoa Touch(即 IOS)项目一起工作,不是吗?

Is there anything I can do with the framework project so that it is valid for other iOS projects? It's confusing because the framework project is a Cocoa Touch Framework project which should naturally work with other Cocoa Touch (i.e. IOS) projects, shouldn't it?

推荐答案

确保在您的 lib 的构建设置中的 Architectures 中列出了 i386x86_64.还将仅构建活动架构明确设置为.

Make sure you have i386 and x86_64 listed in your Architectures in Build settings for your lib. Also set Build Active Architecture Only explicitly to No.

这篇关于Xcode 6.1:文件是为 x86_64 构建的,这不是被链接的架构 (i386)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 21:59