I'm writing a static library for the iPhone and I'm wondering if what I'm doing is recommended or if I should take a different approach.
The static library I'm writing is dependant on libxml2. libxml2 has a dynamic library (dylib) and a static library (a). I've tried two approaches.
Approach one - When I attempt to link against the static library by adding "-lxml2" to "Other linker flags" the build fails with the following message:
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lxml2 is not an object file (not allowed in a library)
Approach two - I can successfully link against the dynamic library from my static library but I'm not sure if this is allowed (or the proper approach) on the iPhone. Even though I'm building a static library, does Apple allow static libraries that link against dynamic libraries? I'm still learning about static libraries, but from my understanding the code from the dylib would be combined with my code to make one library, thus linking against the dylib shouldn't be an issue.
To summarize:
Cocoa Touch is the application development environment for building software programs to run on iOS for the iPhone and iPod Touch, iPadOS for the iPad, watchOS for the Apple Watch, and tvOS for the Apple TV, from Apple Inc. Cocoa Touch. Developer(s) Apple Inc. Operating system.
App Library shows your apps organized into categories, such as Creativity, Social, and Entertainment. The apps you use most are near the top of the screen and at the top level of their categories, so you can easily locate and open them.
libxml2.dylib is available in the SDK. The right way is to double-click the target node/app in Xcode and then under General click the + under "Linked Libraries"...you should find libxml2.dylib in that list.
0:42 in this Screencast you can see how CoreGraphics is added to a project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With