Xcode 11无法识别静态库的体系结构:MacCatalyst(又名UIKitForMac) [英] Xcode 11 not recognizing static library's architecture: MacCatalyst (aka UIKitForMac)
问题描述
在对2019年的WWDC公告感到兴奋之后,我尝试使用Xcode 11.0 beta针对MacOS编译现有的iOS应用.不幸的是,它没有按预期进行.
After getting excited about 2019's WWDC announcements, I tried compiling my existing iOS app against the MacOS using Xcode 11.0 beta. Unfortunately, it didn't go as expected.
Xcode说我的静态库是为<构建的.未知>体系结构:
Xcode says my static library is built for < unknown > architecture:
针对Mac的UIKit构建,但链接库"libssl.a"为 专为<未知>.您可能需要限制平台 该库应该在目标编辑器中链接.
Building for UIKit for Mac, but the linked library 'libssl.a' was built for < unknown >. You may need to restrict the platforms for which this library should be linked in the target editor.
但是当我检查我的静态库时,我可以看到它们确实包含所需的体系结构x86_64
:
But when I check my static libs, I can see they do contain the desired architecture x86_64
:
我认为此问题可能与Xcode Beta错误有关.有人对此有想法吗?
I believe this issue may be related to an Xcode Beta bug. Does anyone have thoughts on this?
推荐答案
单行修复:
git clone git@github.com:marcelosalloum/OpenSSL-for-iPhone.git --branch feature/mac-catalyst && \
cd OpenSSL-for-iPhone && \
./build-libssl.sh --archs="MacOSX_x86_64 i386 arm64 armv7s armv7"
说明:
根据苹果公司的软件工程师 edford ,我们需要针对iOS平台构建二进制文件,以MacOSX
为目标并使用CFLAG
-target x86_64-apple-ios13.0-macabi
.这里有一个非常启发性的讨论: https://forums.developer.apple.com/message/362577 .
Explanation:
According to edford, Apple's software engineer, we need to build our binaries for the iOS platform, targeting MacOSX
and use the CFLAG
-target x86_64-apple-ios13.0-macabi
. There is a very enlightening discussion here: https://forums.developer.apple.com/message/362577.
我在此处进行了分叉,并在分支feature/mac-catalyst
.
I've forked OpenSSL-for-iPhone here and implemented MacCatalyst support in the branch feature/mac-catalyst
.
您可以通过指定archs
或targets
为MacCatalyst
构建它:
You can build it for MacCatalyst
either by specifying archs
or targets
:
git clone git@github.com:marcelosalloum/OpenSSL-for-iPhone.git --branch feature/mac-catalyst && \
cd OpenSSL-for-iPhone && \
./build-libssl.sh --archs="MacOSX_x86_64 i386 arm64 armv7s armv7" --version="1.0.2l"
用于OpenSSL> = 1.1.0的选项--targets
git clone git@github.com:marcelosalloum/OpenSSL-for-iPhone.git --branch feature/mac-catalyst && \
cd OpenSSL-for-iPhone && \
./build-libssl.sh --targets="ios-sim-cross-i386 ios64-cross-arm64 ios-cross-armv7s ios-cross-armv7 mac-catalyst-x86_64" --version="1.1.0"
这篇关于Xcode 11无法识别静态库的体系结构:MacCatalyst(又名UIKitForMac)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!