When building an iOS app in Xcode, you may encounter the following error:
duplicate symbol _hogehoge in: /Users/................../Xxxx.framework/Xxxx(Xxxx.o) /Users/................../Xxxx.framework/Xxxx(Xxxx.o) ld: 1 duplicate symbol for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
This error might appear or not depending on the environment.
It could be related to the -all_load flag in the project's settings. To check this, navigate to the project page → TARGETS → Build Settings → Linking → Other Linker Flags.
When the -all_load flag is included, it evaluates all extern symbols initially (not entirely sure about this), and if there are duplicate symbol names, it will result in an error, preventing the build from succeeding.
When creating a library, try including ( -ObjC and ) -all_load to build and verify the operation.
Comments