Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Other Linker Flags set to -ObjC [duplicate]

I have included Other Linker Flags set to -ObjC in my Build Settings as I would like to use a framework that requires this (https://github.com/rs/SDWebImage)

However after adding this flag I get linker errors:

Undefined symbols for architecture armv7:

"_OBJC_CLASS_$_SKProductsRequest", referenced from:

  objc-class-ref in Parse(PFPurchase.o)

"_OBJC_CLASS_$_SKPayment", referenced from:

  objc-class-ref in Parse(PFPurchase.o)

"_OBJC_CLASS_$_SKPaymentQueue", referenced from:

  objc-class-ref in Parse(PFPurchase.o)

  objc-class-ref in Parse(PFPaymentTransactionObserver.o)

ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Removing the -ObjC linker flag and the project builds again without errors. Any ideas of the cause? Thanks.

like image 802
nivritgupta Avatar asked Nov 29 '22 02:11

nivritgupta


2 Answers

You need to add StoreKit.framework.

Version 1.0.62 of the Parse iOS SDK introduced In-App Purchases. This requires StoreKit.framework to be added to existing Parse iOS projects, even if IAP is not being used.

Do this:

  1. Select your project
  2. Select your target
  3. Select Build Phases
  4. In Link Binaries with Libraries, click +
  5. Search for StoreKit and Add

Then import the framework to your project:

#import "StoreKit/StoreKit.h"

See the same error in this Parse community link.

like image 108
DD_ Avatar answered Dec 14 '22 08:12

DD_


add Storekit framework in your project and use this statement where you use write code for In App Purchage

#import "StoreKit/StoreKit.h"
like image 24
Sumit Mundra Avatar answered Dec 14 '22 08:12

Sumit Mundra