objective-c /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 失败,退出代码 1 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2166408/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 error
提问by Mark Szymanski
Possible Duplicate:
gcc-4.2 failed with exit code 1 iphone
I am getting the error
我收到错误
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
every time I try to run the program on the iPhone device and the Simulator.
每次我尝试在 iPhone 设备和模拟器上运行程序时。
I am also seeing this:
我也看到了这个:
ld: duplicate symbol .objc_class_name_MainView in /Volumes/Mark's Flash Drive/iFtB/build/iFtB.build/Debug-iphonesimulator/iFtB.build/Objects-normal/i386/MainView.o and /Volumes/Mark's Flash Drive/iFtB/build/iFtB.build/Debug-iphonesimulator/iFtB.build/Objects-normal/i386/iFtBAppDelegate.o
too. Could this be part of the problem?
也。这可能是问题的一部分吗?
Thanks in advance,
提前致谢,
Mr. Man
文先生
回答by kennytm
It means the MainViewclass is defined twice or more.
这意味着MainView该类被定义了两次或更多次。
Check:
查看:
- If the
MainViewclass's@implementationappears in any.hfiles. It shouldn't. - If there are 2
MainViewclasses define by you and a third-party library. You may need to rename yourMainViewclass.
- 如果
MainView该类@implementation出现在任何.h文件中。不应该。 - 如果
MainView您定义了2 个类和一个第三方库。您可能需要重命名您的MainView班级。
回答by ethyreal
As KennyTM is correct.
因为 KennyTM 是正确的。
I accidentally imported the .m file instead of the .h an received this lovely error.
我不小心导入了 .m 文件而不是 .h 并收到了这个可爱的错误。
回答by Dilip Rajkumar
I had this same problem when i add Reliability class to my code. I already included tree20 to my project which is having reliability class. So when I add the reliability class again to my class I got the same error. I removed the Reliability code from my project and it works perfect.
当我将 Reliability 类添加到我的代码时,我遇到了同样的问题。我已经将 tree20 包含到我的具有可靠性类的项目中。所以当我再次将可靠性类添加到我的类时,我得到了同样的错误。我从我的项目中删除了可靠性代码,它工作得很好。

