I created my own iOS infrastructure following this tutorial, https://code.google.com/p/ios-static-framework/ , which uses a static library template and aggregates the target with a custom run script to create the framework.
At first it works fine. After including another library in the framework project, an error is created when archiving or building for the device. I think the problem is due to some incorrect settings for this library. But I just donβt know what to try. I tried setting some reasonable other Linker flags from https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/ld.1.html , but no luck. Can anyone help please (
What steps will reproduce the problem?
Follow the instructions, but change the architecture of the Aggregate script from armv6 armv7 to armv7 armv7s . Here is part of the overall goal of the script that I changed. Everything else is the same.
if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]] then SF_OTHER_PLATFORM=iphonesimulator SF_ARCHS=i386 else SF_OTHER_PLATFORM=iphoneos SF_ARCHS="armv7 armv7s" fi
Add an external library to the project, here I use libBlocksKit.a .
- Create a structure, success.
- In another subsidiary project. Turn on my built-in infrastructure.
- Add
-ObjC in the application Purpose> Build Settings> Other linker flags - Archive and get an error. Device for device (iPhone5) also gives an error. But it seems that creating a simulator works.
What mistake?
This error, basically "ld: warning: directory not found for option ... ld: lto: could not combine ... character repeatedly specified!".
ld: warning: directory not found for option '-L/Users/hlung/Dropbox/- Notes/stackoverflow/RealFrameworkApp/RealFrameworkApp/External/BlocksKit' ld: lto: could not merge in /Users/hlung/Library/Developer/Xcode/DerivedData/RealFrameworkTest-evagqzwzyyolhjenkkjbvzibxppf/Build/Products/Debug-iphonesimulator/RealFrameworkTest.framework/RealFrameworkTest(NSObject+BlockObservation.o) because 'Linking globals named 'OBJC_CLASS_$_BKObserver': symbol multiply defined!', using libLTO version 'LLVM version 3.2svn, from Apple Clang 4.2 (build 425.0.28)' for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I archive my child project with only one architecture (e.g. armv7), it works. It shows this error with the architecture of armv7 armv7s ($ (ARCHS_STANDARD_32_BIT)).
What version of the product are you using? What operating system?
OS X 10.8.5, Xcode 4.6.3
== Update 1 ==
- Submitted question on the tutorial code.google.com page Update: 2 weeks no answer.
- I found a set of useful suggestions from this answer . Update: not working
- I created a project so that you can run and see for yourself here
ios objective-c frameworks xcode static-libraries
Hlung
source share