用 C 编程时 Xcode 出错
我正在尝试使用 Xcode 创建一个程序。该程序非常简单,它使用线程。 我已经做对了一切。或者说我是这么想的。出现这个错误,我已经明白这意味着什么了!
命令 /Developer/usr/bin/gcc-4.2 失败,退出代码为 1
以及:
ld: duplicate symbol _thr_inc_low in (... a bunch of crap that is the directory of this file) main.o
您能帮我吗?
I'm trying to create a program using Xcode. The program is very simple, it uses threads.
I have done everything right. Or so I thought. This error comes up and I have do ideia what it means!
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
along with:
ld: duplicate symbol _thr_inc_low in (... a bunch of crap that is the directory of this file) main.o
Can you please help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这意味着您有多个包含符号
_thr_inc_low
的.o
文件或库。常见原因之一是在头文件中定义一个包含在多个源文件中的对象(而不仅仅是声明它,例如使用
extern
或原型)。如果不查看源代码的相关部分,就无法了解更多信息。
It means you have multiple
.o
files or libraries that include the symbol_thr_inc_low
.One of the common reasons for this is defining an object in a header file (rather than just declaring it, say with an
extern
or a prototype) that is included in multiple source files.Can't tell more without seeing the relevant parts of your source code.