Reputation: 86
I am developing an app for iOS. I have created a static library that compiles with no problem on its own.
I followed these instructions to set up my static library. http://www.blog.montgomerie.net/easy-xcode-static-library-subprojects-and-submodules
I also added a "copy headers" build phase then added all the headers as public, since that does not work exactly how it was described in the noted link.
I then pushed it to a Git repository.
After following all of the instructions in the linked article, when I try to build, I receive 150 Apple Mach-O linker errors. Here is the output log http://pastebin.com/Ma2tCK1w
The errors only occur after I start using the static library in the application project - just adding the static library does not cause any issues.
Has anyone else run in to this? I have all the correct Frameworks included, and all the source files are being compiled into the static library. I'm out of ideas at this point, I've followed basically every guide or answer I've found on any forum, SO, etc.
Upvotes: 2
Views: 242
Reputation: 22968
The sample static library created in that blog post was so basic that it only required linking against the basic 3 iOS frameworks: UIKit.framework
, Foundation.framework
and CoreGraphics.framework
. Because the iOS application project templates all include a "link binary with libraries" build phase step with those same 3 frameworks, he was able to include the static library in his iOS app with no additional steps.
Based on your build output, your static library uses the functionality of many additional frameworks, like AddressBook.framework
, AddressBookUI.framework
, CFNetwork.framework
, CoreData.framework
, EventKit.framework
, EventKitUI.framework
, MediaPlayer.framework
, MessageUI.framework
, OpenGLES.framework
, QuartzCore.framework
, SystemConfiguration.framework
, libxml2.dylib
and possibly others. You need to make sure you add all of those frameworks/dylibs to your main iOS app project and include them in the "Link Binary with Libraries" build phase just like they are included in the static library's link build phase.
Upvotes: 1