Integration and Testing

Authorize.Net API questions and help with your payment integration.

Posts: 1
Registered: ‎04-19-2012

iOS5 Integration - Compile Time Errors

I've been trying to get the iOS SDK working in a new app. The app targets iOS 5.1.




Initially I simply added the SDK as a library (dragged all the files into my project) and received 30+ compiler errors (Xcode stopped counting shortly after 30). Most errors were related to my app's usage of Automated Reference Counting. After digging around I determined that the best approach (please feel free to correct me if this is wrong) was to build the SDK as a static library.


After mucking around with the build.config and files to revise them from 4.3 to 5.1, I was able to successfully build it.


I added all of the .h files and the newly created libANMobilePaymentLib.a.


I added #import "AuthNet.h" to the top of the class I want to call it from (specifically, ViewController.h).


So far, so good. No errors.




In ViewController.m, I added the following line to my init:


[AuthNet authNetWithEnvironment:ENV_TEST];


This produced 2 errors. Here is the print out:


Ld /Users/marioparise/Library/Developer/Xcode/DerivedData/smr-eethymwozobssbdumgpocjynucke/Build/Products/Debug-iphoneos/ normal armv7
    cd /Users/marioparise/Desktop/Xcode/smr
    setenv PATH "/Applications/"
    /Applications/ -arch armv7 -isysroot /Applications/ -L/Users/marioparise/Library/Developer/Xcode/DerivedData/smr-eethymwozobssbdumgpocjynucke/Build/Products/Debug-iphoneos -F/Users/marioparise/Library/Developer/Xcode/DerivedData/smr-eethymwozobssbdumgpocjynucke/Build/Products/Debug-iphoneos -F/Users/marioparise/Desktop/Xcode/smr -F/Users/marioparise/Desktop/Xcode/smr/smr -filelist /Users/marioparise/Library/Developer/Xcode/DerivedData/smr-eethymwozobssbdumgpocjynucke/Build/Intermediates/ -dead_strip -lxml2 -fobjc-arc -miphoneos-version-min=5.1 -framework SystemConfiguration -framework UIKit -framework Foundation -framework CoreGraphics -framework MapKit -framework CoreLocation -o /Users/marioparise/Library/Developer/Xcode/DerivedData/smr-eethymwozobssbdumgpocjynucke/Build/Products/Debug-iphoneos/

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


Any thoughts on what I'm doing wrong? Is my whole approach off?


Any help would be much appreciated!!!

Posts: 591
Registered: ‎08-21-2009

Re: iOS5 Integration - Compile Time Errors

This is something that I wasn't able to answer myself, so I talked to one of our iOS developers about the issue.  It sounds like the most likely problem is that the library is not being correctly linked.  You'll want to make sure that your project file that you've added the library as a selected target.  You'll also need to make sure that libANMobilePaymentRelease.a is present as a binary link in the project build phases.

Posts: 4
Registered: ‎10-29-2012

Re: iOS5 Integration - Compile Time Errors


Can you tell me what changes to did to the build.config and to make it work. I have been struggling a lot but I am getting all kinds of error. When I run the I get the error libxml2/tree.h not found. How do I get around this?


Any kind of help is much appreciated.