1
votes

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)

1
do you use any external library? probably they were not built for x86_64 - fatihk
how to fix in simulator - Barani
@angelina - i am using external library.how to fix it - Barani
Those external libraries should also be built for x86_64 environment - fatihk
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

1 Answers

0
votes

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