编译错误 ld: 41 duplicate symbols for architecture x86_64

Xcode输出这种错误

ld: 41 duplicate symbols for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

FinallyI find out the reason of this error cause I added -ObjC to the Other Linker Flags.

Reason:accepted41 duplicate symbols for architecture x86_64Means that you have loaded same functions twice. As the issue disappear after removing -ObjCfrom Other Linker Flags, this means that this option result that functions loads twice:

from Technical Q&AThis 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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 嘈杂绚烂的酒吧里,坐着一个看起来与周围环境格格不入的美人。 她坐在吧台上,仿佛沉浸在自己的世界里,一口一口,吐着烟...
    阿慧阿阅读 3,365评论 0 0
  • 从那以后,我有意无意的少出门,以避免和他碰面。 真走巧了遇见,也不明显的变换路线,反而主动笑着点点头,把他惊愕之后...
    静水寒烟阅读 3,372评论 19 7
  • 传说中,衣襟上的第二颗纽扣是属于情人的。 1.扣子锁心 纽扣是乳白色的,四个扣眼略微发黄,看起来像是存放了很久,事...
    九松子阅读 3,968评论 3 4