1

I am getting this error report. How to fix it?

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)

Yu Hao
  • 119,891
  • 44
  • 235
  • 294
Barani
  • 84
  • 1
  • 1
  • 12
  • do you use any external library? probably they were not built for x86_64 – fatihk Oct 30 '15 at 06:13
  • how to fix in simulator – Barani Oct 30 '15 at 06:34
  • @angelina - i am using external library.how to fix it – Barani Oct 30 '15 at 06:47
  • Those external libraries should also be built for x86_64 environment – fatihk Oct 30 '15 at 06:49
  • Hi check in all the classes your importing statements # import "PBPayPalViewController.h" file or by mistaken your #import "PBPayPalViewController.m". if exist change to #import "PBPayPalViewController.h" pls reply still find any issue – Arun Oct 30 '15 at 07:21

1 Answers1

0

At first, add a bridging header for paypal. see this [How to call Objective-C code from Swift ]

Then include header into the header file for paypal. For example, In my case I use #import "PayPalMobile.h".

Link the frameworks for that library in the Linker section of "Build Phase" Settings.

Finally, Clean and re-build the project. enter image description here

Community
  • 1
  • 1
G A
  • 67
  • 2
  • 13