Xcode 5.1 和 x86_64 架构的编译错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22330594/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:44:42  来源:igfitidea点击:

Xcode 5.1 and compiling error for architecture x86_64

iosobjective-cxcodepaypalx86-64

提问by Gabriel.Massana

Yesterday I had a project working without problem with Xcode 5. Today, after the update to Xcode 5.1 i have 6 errors and the project is not compiling.

昨天我有一个项目在使用 Xcode 5 时没有问题。今天,在更新到 Xcode 5.1 后,我有 6 个错误并且该项目没有编译。

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_PayPal", referenced from:
      objc-class-ref in SUAppDelegate.o
      objc-class-ref in SUTViewController.o
  "_OBJC_CLASS_$_PayPalAdvancedPayment", referenced from:
      objc-class-ref in SUTViewController.o
  "_OBJC_CLASS_$_PayPalInvoiceData", referenced from:
      objc-class-ref in SUTViewController.o
  "_OBJC_CLASS_$_PayPalInvoiceItem", referenced from:
      objc-class-ref in SUTViewController.o
  "_OBJC_CLASS_$_PayPalReceiverPaymentDetails", referenced from:
      objc-class-ref in SUTViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The project includes the PayPal libraryand it is linked properly into the code. It is there, I can see the library, so it is not a missing library.

该项目包含PayPal 库,并正确链接到代码中。它在那里,我可以看到图书馆,所以它不是一个缺失的图书馆。

Running the code in the 6.1 Simulator compiles without problem.

在 6.1 Simulator 中运行代码编译没有问题。

Can be a problem with the new Xcode 5.1 feature "Updates the iOS standard architecture setting to include 64-bit." ?

新的 Xcode 5.1 功能“更新 iOS 标准架构设置以包含 64 位。”可能有问题?

Maybe I should change the standard Architecture? Or something related to the PayPal library?

也许我应该更改标准架构?或者与 PayPal 库相关的东西?

Someone know how to solve that?

有人知道怎么解决吗?

回答by Hardik Darji

Select app target's Build Settings, select Architectures, click on Other... and remove $(ARCHS_STANDARD)and add $(ARCHS_STANDARD_32_BIT)

选择 app target 的 Build Settings,选择 Architectures,点击 Other... 并 删除 $(ARCHS_STANDARD)添加 $(ARCHS_STANDARD_32_BIT)

Below is image for sameIn app Target's ->Build Settings ->Architectures

下面是相同的图像在应用程序 Target 中 ->构建设置 ->架构

Its fix the issue for me.

它为我解决了这个问题。

回答by Pawan Rai

i think the paypal library you are using, does not support arm64.

我认为您使用的贝宝库不支持 arm64。

check this PayPal-iOS-SDK issue-47for the updated paypal library.

检查此PayPal-iOS-SDK issue-47以获取更新的 paypal 库。

Edit :- update linkfor paypal library (with arm64 support)

编辑:-更新贝宝库的链接(支持 arm64)

回答by Brandon J Brotsky

I found this task to be difficult myself so I made a video explaining how to remove the arm64 from the valid architectures. Hope it helps!

我自己发现这个任务很困难,所以我制作了一个视频,解释了如何从有效架构中删除 arm64。希望能帮助到你!

https://www.youtube.com/watch?v=d-pJLRy4rVk&feature=youtube_gdata_player

https://www.youtube.com/watch?v=d-pJLRy4rVk&feature=youtube_gdata_player

回答by masouk

Go to Targets -> Build Settings -> Linking -> Other Linker Flags Add -ObjC -l"PayPalMobile" -l"Pods-PayPal-iOS-SDK" -l"c++" -framework "AVFoundation" -framework "AudioToolbox" -framework "CoreLocation" -framework "CoreMedia" -framework "MessageUI" -framework "MobileCoreServices" -framework "SystemConfiguration"

转到目标 -> 构建设置 -> 链接 -> 其他链接器标志添加 -ObjC -l"PayPalMobile" -l"Pods-PayPal-iOS-SDK" -l"c++" -framework "AVFoundation" -framework "AudioToolbox" -框架“CoreLocation”-框架“CoreMedia”-框架“MessageUI”-框架“MobileCoreServices”-框架“系统配置”

回答by Nikita Ivaniushchenko

If you just miss x86_64 architecture (but you have arm64) and it's not possible to get library that includes x86_64 architecture, do the following:

如果您只是想念 x86_64 架构(但您有 arm64)并且无法获得包含 x86_64 架构的库,请执行以下操作:

adding different architectures for different SDKs

adding different architectures for different SDKs

回答by JaydenLiang

In addition to Nikita's answer, you could change the parameter from "i386" to x86_64to compile the library matching x86_64architecture. Then the compiling errors will go away.

除了 Nikita 的回答之外,您还可以将参数从“i386”更改x86_64为编译库匹配x86_64架构。然后编译错误就会消失。