Getting Inconsistent Duplicate Symbol Linker Errors

iOS
2015-08-07 10:49 (9 years ago) ytyng

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.

Current rating: 1

Comments

Archive

2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011