/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 error [duplicate]

社会主义新天地 提交于 2019-11-27 02:53:39

问题


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.

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


回答1:


It means the MainView class is defined twice or more.

Check:

  1. If the MainView class's @implementation appears in any .h files. It shouldn't.
  2. If there are 2 MainView classes define by you and a third-party library. You may need to rename your MainView class.



回答2:


As KennyTM is correct.

I accidentally imported the .m file instead of the .h an received this lovely error.




回答3:


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.



来源:https://stackoverflow.com/questions/2166408/developer-platforms-iphonesimulator-platform-developer-usr-bin-gcc-4-2-failed-w

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