2015-10-30 21 views
1

我收到此錯誤報告。如何解決它?如何解決ios中的這種架構錯誤?

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_PayPalPayment", referenced from: objc-class-ref in PBMainViewController.o "_OBJC_CLASS_$_PayPalPaymentViewController", referenced from: _OBJC_CLASS_$_PBPayPalViewController in PBPayPalViewController.o "_OBJC_METACLASS_$_PayPalPaymentViewController", referenced from: _OBJC_METACLASS_$_PBPayPalViewController in PBPayPalViewController.o "_PayPalEnvironmentNoNetwork", referenced from: -[PBMainViewController payWithPayPal:] in

PBMainViewController

.o ld:

symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

+0

你使用任何外部庫嗎?可能它們不是爲x86_64構建的 –

+0

嘗試設備一次 –

+0

如何在模擬器中修復 – Barani

回答

0

首先,爲貝寶添加一個橋接頭。看到這個[How to call Objective-C code from Swift]

然後將頭部包含到貝寶的頭文件中。例如,在我的情況下,我使用#import「PayPalMobile.h」。

在「構建階段」設置的鏈接器部分中鏈接該庫的框架。

最後, 清理並重新構建項目。 enter image description here