我为 util/extensions 创建了一个 Swift 框架项目,它编译并复制一个 .framework
文件到我系统上的专用位置.我希望能够将此文件包含到其他项目中(Build Phases/Link Binary with Libraries).框架项目是 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
ld: warning: ignoring file /Users/name/Projects/Xcode/Libs/swiftutils.framework/swiftutils, file was built for x86_64 which is not the architecture being linked (i386): /Users/name/Projects/Xcode/Libs/swiftutils.framework/swiftutils
我可以对框架项目做些什么以使其对其他 iOS 项目有效?这很令人困惑,因为框架项目是一个 Cocoa Touch 框架项目,它应该自然地与其他 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 的 Build settings 中的 Architectures 中列出了 i386
和 x86_64
.还将 Build Active Architecture Only 明确设置为 No.
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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!