简体   繁体   English

Xcode:架构 arm64 错误的未定义符号

[英]Xcode: Undefined symbols for architecture arm64 error

In my Xcode 5 project I use RestKit for REST communication.在我的 Xcode 5 项目中,我使用 RestKit 进行 REST 通信。 Everything works fine with the simulators, but generating the ipa file, I get the following error:模拟器一切正常,但生成 ipa 文件时,出现以下错误:

ld: warning: ignoring file /Users/joseph/Library/Developer/Xcode/DerivedData/XXXXXXXXXX-gdwdekevxtdfivfpsnmyykeqhulk/Build/Products/Debug-iphoneos/libRestKit.a, missing required architecture arm64 in file /Users/joseph/Library/Developer/Xcode/DerivedData/XXXXXXXXXXXXX-gdwdekevxtdfivfpsnmyykeqhulk/Build/Products/Debug-iphoneos/libRestKit.a (2 slices)
Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$_RKRelationshipMapping", referenced from:
      objc-class-ref in classname-xxx.o
  "_OBJC_CLASS_$_RKObjectMapping", referenced from:
      objc-class-ref in classname-xxx.o
  "_OBJC_CLASS_$_RKRequestDescriptor", referenced from:
      objc-class-ref in classname-xxx.o
  "_OBJC_CLASS_$_RKObjectManager", referenced from:
      objc-class-ref in classname-xxx.o
  "_OBJC_CLASS_$_RKResponseDescriptor", referenced from:
      objc-class-ref in classname-xxx.o

  "_RKStatusCodeIndexSetForClass", referenced from:
      -[classname-xxx classname-Method] in classname-xxx.o
      -[classname-xxx classname-Method] in classname-xxx.o
      -[classname-xxx classname-Method] in classname-xxx.o
      -[classname-xxx classname-Method] in classname-xxx.o
      -[classname-xxx classname-Method] in classname-xxx.o
  "_RKMIMETypeJSON", referenced from:
      -[classname-xxxinitWithURLBase:timeOut:] in classname-xxx.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation).

If in RestKit project, I change in "Build Settings" -> "Architectures" the "Standard architectures (ARMv7, armv7s)" by Standard architectures (including 64-bit) (ARMv7, armv7s, arm64) option, everything compiles fine .如果在 RestKit 项目中,我通过标准体系结构(包括 64 位)(ARMv7、armv7s、arm64)选项在“构建设置”->“体系结构”中更改“标准体系结构(ARMv7,armv7s)”,则一切都可以正常编译。 Is this correct?, Does not bring any result, I have to change some other settings.这是正确的吗?,没有带来任何结果,我必须更改一些其他设置。

  1. Select Restkit project选择 Restkit 项目
  2. Set the Build Active Architecture Only to No仅构建活动架构设置为No

仅构建主动架构

这只是意味着您正在为 64 位(iPhone 5s)构建您的项目,无需担心,请参阅此链接以获取更多解释: Xcode 5 和 iOS 7:架构和有效架构

Just change in RestKit project -> Build Settings -> Architectures to Standard Architecture (armv7, armv7s, arm64).只需将 RestKit 项目 -> 构建设置 -> 架构更改为标准架构(armv7、armv7s、arm64)。 After that everything should work.之后,一切都应该工作。

This worked for me:这对我有用:

ios sdk 9.3 IOS SDK 9.3

into your build setting of app.xcodeproj valid architecture: armv7 armv7s Build Active architecture : No进入 app.xcodeproj 的构建设置有效架构​​:armv7 armv7s 构建活动架构:否

Clean and build , worked for me.清洁和建造,为我工作。

In my case i forgot to add sqlite library in my project.就我而言,我忘记在我的项目中添加 sqlite 库。 After adding library from Linked framework and library the build was successful.从链接框架和库添加库后,构建成功。

I ran into the same/similar issue implementing AVPictureInPictureController and the issue was that I wasn't linking the AVKit framework in my project.我在实现 AVPictureInPictureController 时遇到了相同/类似的问题,问题是我没有在我的项目中链接 AVKit 框架。

The error message was:错误消息是:

Undefined symbols for architecture armv7:架构 armv7 的未定义符号:

"_OBJC_CLASS_$_AVPictureInPictureController", 
referenced from:
   objc-class-ref in yourTarget.a(yourObject.o)
ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation) The Solution: clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) 解决方案:

Go to your Project Select your Target Then, go to Build Phases Open Link Binary With Libraries Finally, just add + the AVKit framework / any other framework.转到您的项目 选择您的目标 然后,转到 Build Phases Open Link Binary With Libraries 最后,只需添加 + AVKit 框架/任何其他框架。 Hopefully this helps someone else running into a similar issue I had.希望这可以帮助其他人遇到我遇到的类似问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM