7

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

0

3 Answers 3

11

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.
4
  • I know this is an old post, but just wanted to say thanks for this answer. Fixed my problem too. :) Jan 10, 2011 at 3:11
  • @sudo: How did u fix this problem?
    – RK-
    May 19, 2011 at 6:38
  • @Krishnan: Yikes, that was a while ago. Just look to see if you have a duplicate file somewhere. Search your entire project for the name of the class in question and see if it's duplicated. May 19, 2011 at 7:29
  • Great! The problem appeared that I added a view class twice (which was inside an another folder).
    – nomann
    Feb 2, 2012 at 10:04
4

As KennyTM is correct.

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

1
  • This was also the case with me.
    – jmosesman
    Feb 10, 2012 at 18:06
0

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.