Duplicate symbols for architecture x86_64 under Xcode
For me, changing 'No Common Blocks' from Yes to No ( under Targets->Build Settings->Apple LLVM - Code Generation ) fixed the problem.
Stupid one, but make sure you haven't #import
ed a .m
file by mistake somewhere
75 duplicate symbols for architecture x86_64
Means that you have loaded same functions twice.
As the issue disappear after removing -ObjC
from Other Linker Flags,
this means that this option result that functions loads twice:
from Technical Q&A
This flag causes the linker to load every object file in the library that defines an Objective-C class or category. While this option will typically result in a larger executable (due to additional object code loaded into the application), it will allow the successful creation of effective Objective-C static libraries that contain categories on existing classes.
https://developer.apple.com/library/content/qa/qa1490/_index.html
In my case, I just created a header file to define constant strings like this:
NSString *const AppDescriptionString = @"Healthy is the best way to keep fit";
I solved this scenario by using static
:
static NSString *const AppDescriptionString = @"Healthy is the best way to keep fit";