[英]universal IOS static library with i386 x86_64 armv7 armv7s arm64
I need to create an universal library of a Cocoa Touch Static library project, 我需要创建一个Cocoa Touch Static库项目的通用库,
I am using 我在用
xcodebuild -target mysdsk ONLY_ACTIVE_ARCH=NO VALID_ARCHS="arm64 armv7 armv7s i386 x86_64" -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
Even if I split the iphonesimulator as two xcodebuild still I could not get i386 for iphone4 simuator 即使我将iphonesimulator拆分为两个xcodebuild,也无法将i386用于iphone4模拟器
I am getting error 我遇到错误
Undefined symbols for architecture i386
Based on How do I determine the target architecture of static library (.a) on Mac OS X? 基于如何确定Mac OS X上静态库(.a)的目标体系结构?
I tried to run the file command, it displays 我试图运行file命令,它显示
mysdsk.a: Mach-O universal binary with 5 architectures
mysdsk.a (for architecture i386): current ar archive random library
mysdsk.a (for architecture armv7): current ar archive random library
mysdsk.a (for architecture armv7s): current ar archive random library
mysdsk.a (for architecture x86_64): current ar archive random library
mysdsk.a (for architecture arm64): current ar archive random library
But still I am getting error 但是我仍然出错
Undefined symbols for architecture i386
Whatever method you have followed, From the list of architectures I think everything is fine. 无论采用哪种方法,从体系结构列表中,我都认为一切都很好。
There is one issue with XCode that even if you drag an drop the mysdsk.a or change inside the linker setttings, The XCode can still pick a wrong file which is stored inside XCode有一个问题,即使您拖放mysdsk.a或更改链接器设置内部,XCode仍然可以选择一个错误的文件,该文件存储在内部
/Users/<your username>/Library/Developer/Xcode/DerivedData/mysdsk_........ folder
You can identify from XCode warnings saying 3 slices but it is actually 5 slices 您可以从XCode警告中识别出3片,但实际上是5片
ld: warning: ignoring file /Users//Library/Developer/Xcode/DerivedData/mysdsk_......./..../mysdsk.a, missing required architecture i386 in file /Users//Library/Developer/Xcode/DerivedData/mysdsk_......./..../mysdsk.a (3 slices)ld:警告:忽略文件/Users//Library/Developer/Xcode/DerivedData/mysdsk_......./..../mysdsk.a,文件/ Users // Library / Developer /中缺少必需的体系结构i386 Xcode / DerivedData / mysdsk _....... / .... / mysdsk.a(3片)
Therefore Delete the folder /Users//Library/Developer/Xcode/DerivedData/mysdsk_........ 因此,删除文件夹/ Users // Library / Developer / Xcode / DerivedData / mysdsk_........。
Then it should be working fine, Actually I identified this issue that the other machine works fine but my machine was not working. 然后,它应该可以正常工作。实际上,我发现此问题是另一台计算机可以正常工作,但是我的计算机无法正常工作。
Reference ignoring file [path] missing required architecture i386 in file 引用忽略文件[path]文件中缺少必需的体系结构i386
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.