Archived Forum Post

Index of archived forum posts

Question:

Running in iOS Simulator - Error

Apr 16 '15 at 04:01

Hi there, Using ftp2 in iOS app. Works fine on device, but in the sumulator I get the linker error shown below. I wasn't sure what libchilkatIos.a to add, so I added then all! For all the different architectures. Works fine on actual hardware but not in Simulator. Any ideas out there? Rob.

ld: warning: ignoring file /Users/Rob/Downloads/chilkat-9.5.0-ios/lib/arm64/libchilkatIos.a, file was built for archive which is not the architecture being linked (i386): /Users/Rob/Downloads/chilkat-9.5.0-ios/lib/arm64/libchilkatIos.a
Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_CkoFtp2", referenced from:
      objc-class-ref in ScannerViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Answer

The error message shows you're linking against:
/Users/Rob/Downloads/chilkat-9.5.0-ios/lib/arm64/libchilkatIos.a

However, you're trying to link for the simulator and in that case you certainly don't want the arm64/libchilkatIos.a

If you look, you'll find that the /Users/Rob/Downloads/chilkat-9.5.0-ios/lib/i386/libchilkatIos.a library is present. Make sure to link with that one..


Answer

No idea how I fixed this, but if I moved the location of the lib folder to somewhere else, deleted the old folder, then added the libs from the new location, everything works fine! Wow XCODE! I have a question about how to support arm64 and armv7 in an application when submitting to app store, but I'll save that for a new question when the time comes. Maybe the app store will allow uploading separate apps for different archs.