Strip payment library and undefined symbols for x86_64

I just started trying out the new Stripe SDK to integrate Apple payments and make a mistake in the first step. I am using the Xcode 6 version of GM. I followed these instructions.

I turned on the Stripe library by cloning from GitHub and copying the folder to my project.

I didn’t even start coding anything, I continue to encounter a MACH-O linker error during build.

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

I tried to delete the Derivative Data folder and clear the build folder as indicated in this link: Xcode / PhoneGap - Apple Mach-O Linker Error . Do not use. I tried to include the library in Objective-C and Swift projects.

Does anyone come across this problem or can give any hints on how to solve it? Other Swift projects compile fine, which is unpleasant.

Ok, I tried the lipo command, here's the output:

 yoda:~ manju$ lipo -info libstripe.a fatal error: /Users/manju/Documents/xcode 6/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: libstripe.a (No such file or directory) 
+2
source share
2 answers

The reason it does not compile is due to:

#if __IPHONE_OS_VERSION_MAX_ALLOWED> = 80000

#endif

in STEPTestPaymentAuthorizationViewController and PKPayment + STPTestKeys both .h and .m files

This should mean that __IPHONE_OS_VERSION_MAX_ALLOWED is <80000. I have iOS 8 and the latest version of Xcode this week. Do you know how I can set the max allowed for an earlier version of iOS?

+1
source

I had the same problem, and as Joshua Said said above,

 #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 #endif 

Causes a problem.

However, removing it from the source would mean that I would have to remove the validation from each file in each project into which I imported Stripe, and that looked a bit overkill.

I got a compilation project after looking at the Stripe example code in the StripeExample-Prefix.pch file (in supporting files), which has the following:

 // // Prefix header // // The contents of this file are implicitly included at the beginning of every source file. // #import <Availability.h> #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #endif 

As soon as I added #import <Availability.h> to my .pch and installed the "Precompile Prefix Header" in Yes my Build Settings, my project was compiled without any problems.

0
source

Source: https://habr.com/ru/post/978973/


All Articles