iOS静态库在x86_64架构下出现未定义符号错误

3

我可以帮您翻译与IT技术相关的内容。以下是需要翻译的内容:

lipo -info libXxxx.a fat文件中的体系结构为:libXxxx.a包括:armv7 i386 arm64

但是,依赖项目中的编译器出现链接错误。

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)

我有点不明白?所有库项目的目标都有架构:标准架构(armv7,arm64)和有效架构 arm64,armv7,armv7s。

在我的lipo命令中,我正在从iphonesimulator和iphoneos文件夹中同时进行lipo操作以创建通用二进制文件。


你正在为iphonesimulator和iphoneos文件夹进行lipo操作以创建一个通用文件,这是正确的,但它不支持x86_64架构,请参考已发布的答案。 - Sanjay Mohnani
2个回答

0
error, status code: 429, message: Rate limit reached for default-gpt-3.5-turbo in organization org-qFscWyhea1fBgnuf4678Pgia on requests per min. Limit: 3 / min. Please try again in 20s. Contact us through our help center at help.openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.

3
在Xcode 6.2中,是否有通用选项?我只看到标准架构。但在有效架构中,我设置了全部:arm64、armv7、armv7s、x86_64、i386。 - karim

0

您需要在您的静态库项目中创建一个包含以下架构的通用二进制文件。这些架构应该包括64位、armv7、armv7s和arm64。

现在,当您在终端上执行lipo -info anyStaticLibrary.a命令时,您应该看到armv7 armv7s i386 x86_64 arm64架构的fat二进制文件。

还请注意,使用上述静态库的项目可以在默认架构设置下正常工作。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接