Linker command failed with exit code 1 In Xcode

杀马特。学长 韩版系。学妹 提交于 2019-12-12 17:07:01

问题


I'm writing C program in Xcode, and I got this problem:

ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any idea to solve it?

Note: I've just update my OS to Mountain Lion yesterday.


回答1:


A common error is to define a symbol in a header when you wanted to declare it:

When you for instance declare a global variable and forget the extern or you define an inline function and forget the inline. In these cases the compiler emits the symbol in each compile unit that includes this header and you end up with multiple definitions of a symbol.

Anyway you should just look for the symbol in question.



来源:https://stackoverflow.com/questions/11704448/linker-command-failed-with-exit-code-1-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!