Question

One of the components that I use for my app demands that I use -all_load as one of its linker flags. But when I add this flag, I get an errors from another library that I use in my app. When I archive the app, I get the following errors:

Apple Mach-O Linker Error 64 duplicate symbols for architecture armv7s

What is the solution for this situation?

Was it helpful?

Solution

Just remove that flag and try without it. If still doesn't work try using --force-load per library.

OTHER TIPS

Do not try to run your code with no load flag. The reason for the flag is to deal with an Apple linker problem where categories in ObjectiveC libraries do not get processed properly. Try switching to this:

-force_load $(BUILD_PRODUCTS_DIR)/libfoo.a 

EDIT: I have read but not verified that as of Xcode 4.6 this is no longer necessary.

David H's answer is basically correct but has two typos in the code sample. The linker parameters should be as follows for the library that requires the special load behavior:

-force_load $(BUILT_PRODUCTS_DIR)/libfoo.a 

Note: I have encountered a similar situation in my project (using Xcode 4.6.1), but the app still wouldn't link when neither -all_load nor -force_load were specified (targeting both iOS5 and iOS6).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top