2011-10-13 40 views
-2

我正在尝试使用Xcode创建程序。该程序非常简单,它使用线程。 我已经做好了一切。或者我想。这个错误出现了,我意识到它意味着什么!Xcode在编程时出错C

Command /Developer/usr/bin/gcc-4.2 failed with exit code 1

连同:

ld: duplicate symbol _thr_inc_low in (... a bunch of crap that is the directory of this file) main.o 

你能帮帮我吗?

回答

1

这意味着您有多个.o文件或库,其中包含符号_thr_inc_low

其中一个常见的原因是在一个头文件中定义一个对象(而不是仅仅声明它,比如extern或原型),它包含在多个源文件中。

如果没有看到源代码的相关部分,则无法分辨。