. Advertisement .
..3..
. Advertisement .
..4..
I get the “duplicate symbols for architecture x86_64” issue when trying to add -ObjC to the Other Linker Flags. Here is the detail of the error I got the error message:
/Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Intermediates/TestMoboSDK-Client.build/Debug-iphonesimulator/TestMoboSDK-Client.build/Objects-normal/x86_64/MoboSDK.o
/Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Products/Debug-iphonesimulator/libMoboSDK.a(MoboSDK.o)
duplicate symbol _OBJC_METACLASS_$_MoboSDK in:
/Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Intermediates/TestMoboSDK-Client.build/Debug-iphonesimulator/TestMoboSDK-Client.build/Objects-normal/x86_64/MoboSDK.o
/Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Products/Debug-iphonesimulator/libMoboSDK.a(MoboSDK.o)
ld: 75 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please give me some advice to solve this problem.
The cause: In my opinion, the cause of this error is that you have loaded same functions twice. As the problem goes away after deleting the
-ObjC
fromOther Linker Flags
, this option results ithat functions loads twiceSolution: You can fix this error by changing ‘No Common Blocks’ from Yes to No ( under Targets->Build Settings->Apple LLVM – Code Generation )
My solution was to change ‘No Common Blocks” from Yes to No under Targets->Build Setting->Apple LLVM – Code Generation