问题描述
lipo -info libXxxx.a胖文件:libXxxx.a 中的架构为:armv7 i386 arm64
lipo -info libXxxx.aArchitectures in the fat file: libXxxx.a are: armv7 i386 arm64
但是依赖项目中的编译器给出了链接错误,
But compiler in the dependant project is giving linking error,
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_ClassXXXX", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我错过了什么吗?所有 lib 项目的目标都有 Architectures: Standard Architectures (armv7, arm64)和有效架构 arm64、armv7、armv7s
Am I missing something?All the lib project's target have Architectures: Standard Architectures (armv7, arm64)and Valid Architectures arm64, armv7, armv7s
在我制作通用二进制文件的 lipo 命令中,我同时从 iphonesimulator 和 iphoneos 文件夹进行 lipo 处理.
in my lipo command while making universal binary I am lipo-ing both from iphonesimulator and iphoneos folder.
推荐答案
您的主要线索是它说找不到架构 x86_64 的符号"而不是找不到架构 i386 的符号".
Your main clue is that it says "symbol(s) not found for architecture x86_64" instead of "symbol(s) not found for architecture i386".
修复方法是调整您的构建设置以允许 32 位构建.
The fix is to tweak your build settings to allow a 32-bit build.
1) 在项目导航器(左侧边栏)中选择您的项目文件
1) Select your project file in the Project Navigator (the left sidebar)
2) 选择您项目的目标(在刚刚出现的面板中 TARGETS 下的第一个条目)
2) Select your project's target (first entry under TARGETS in the panel that just came up)
3) 找到Architectures"设置(如果找不到Architectures",请确保选择All")
3) Find the "Architectures" setting (make sure "All" is selected if you can't find "Architectures")
4) 将其从标准架构"更改为通用"(或明确的32 位",如果您愿意)
4) Change it from "Standard Architectures" to "Universal" (or explicitly "32-bit" if you prefer)
完成此操作后,您应该能够构建.
You should be able to build after doing this.
这篇关于ios 静态库 x86_64 架构的未定义符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!