问题
I am having an issue while building an iOS app with Cordova and a third-party plugin that ships with a native SDK. Cordova requires Linker Flag "-all_load" which other SDK is not happy about.
I read this post about "-all_load" flag: Alternative for all_load in XCode's Other Linker Flags sounds like I might be able to use "-force_load" instead and specify the "object file" that Cordova wants.
I do not know much about the Cordova's internals. Has anyone had the same problem and was successfully able to compile Cordova with "force_load"? Could you provide your Cordova specific "force_load" syntax?
回答1:
The problem here is that libraries containing categories did not properly load in earlier versions of Xcode. As of 4.6 they should be loading, and you should be able to just use the linker flag "-ObjC", which tells the linker to examine the libraries for such things.
If for some reason the -ObjC flag does not work, the syntax for the force load is"
-force_load $(BUILT_PRODUCTS_DIR)/libxyz.a
回答2:
Thanks to pointers from @David H, I was able to replace the Other Linker Flags "-all_load" switch by:
-force_load $(BUILT_PRODUCTS_DIR)/libCordova.a
Cordova now compiles and starts fine without breaking my other libraries that do not like "-all_load"
来源:https://stackoverflow.com/questions/16683090/cordova-build-without-all-load