Chilkat Cocoa Objective-C Library Compile and Linking Notes
1) Link with the Chilkat Static Library
- libChilkatCocoa.a for MacOSX
- libChilkatIos.a for iOS
- libChilkatWatchOS.a for watchOS
- libChilkatTvOS.a for tvOS
Go to your project's Build Phases (the tab located just to the right of Build Settings) and add the libChilkatCocoa.a (for MacOSX) or libChilkatIos.a (for iOS).
Do this by expanding the Link Binary with Libraries section, then click on "+" to add items, then click on the Add Other button. Navigate to the directory where the Chilkat static lib (.a) located and add it.
2) Link with -lresolv, -lpthread, and -lstdc++
In Build Settings, Add -lresolv -lpthread -lstdc++ to Other Linker Flags.
3) Note about libChilkatIos.a
The libChilkatIos.a is a Universal Static Library that contains individual static libs, one for each architecture, such as arm64, armv7s, x86_64, etc. Chilkat provides a makeUniversalLib.sh shell script for creating the universal lib. You'll need to run this script to create the libChilkatIos.a. You may edit the makeUniversalLib.sh to remove those architectures that are unneeded. See Building an iOS Universal Chilkat Static Library
4) How to Distribute a dylib with your Application
See this Chilkat Forum post: How to Distribute a dylib with your Application.
All objects returned by Chilkat methods, including NSString, NSNumber, NSData, NSMutableData, NSDate, and "Cko" Chilkat objects are autorelease. The application does not need to release them.
Important: See this note on the Chilkat blog about Auto-Release in Background Threads.
6) .mm Source File Extension
Any application source file that includes a Chilkat header (.h) must be named using the .mm file extension.