gcc-4.2 failed with exit code 1 iphone

2019-01-04 02:45发布

I've seen this error with different variations on discussion forums but being a non programmer I'm not sure how to progress this.

Basically I have code which I found to help me with changing the background colors of cells on a grouped uitableview. The code introduced a line as such:

CGContextAddArcToPoint(c, minx, miny, midx, miny, ROUND_SIZE);

This gave an error indicated that it wasn't declared, so I added to my .h file the following under import uikit:

#import <UIKit/UIKit.h>
#define ROUND_SIZE 10

Now it shows that I have an error:

Command/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 iphone

Some discussions talk about libraries but because I don't have a programming background I don't understand what to do. I also see that some people show a log output but I'm not sure where that comes from as I don't get any debug windows because I'm guessing it doesn't get that far. I simply click 'Build and Go' and I get this error in the Message window.

Any thoughts?

19条回答
干净又极端
2楼-- · 2019-01-04 02:46

You can see the error message output from GCC by selecting "Build Results" from the "Build" menu or by pressing ⇧⌘B.

查看更多
小情绪 Triste *
3楼-- · 2019-01-04 02:46

Here is one of the possible solutions:

Remove the .m(implementation) file import statement from the viewController class if it is included along with related .h(header) file.

Instead of including (by mistake)

#include "myClass.h"
#include "myClass.m" 

Include only the required header file as:

#include "myClass.h"

Thanks, Prodeveloper

查看更多
够拽才男人
4楼-- · 2019-01-04 02:48

I was getting this error on building a cocos2d project using xcode 4.3 on Lion. To fix this error, I followed the instructions here: http://www.mac.ph/cocos2d-templates-and-xcode-43

查看更多
别忘想泡老子
5楼-- · 2019-01-04 02:49

I've gotten the same error and solved in a very strange way. Cleaning and rebuilding the project doesn't solve it but simply adding an empty line in ApplicationViewController.mm has forced the compiler to rebuild "something" and the error has gone by itself.

I just add that the same project compiles without error on iMac and failed on macBook.

查看更多
倾城 Initia
6楼-- · 2019-01-04 02:51

This type of exit code error occures due to Any of your framework or Library overlap. so solve this problem check your error log and find out duplicate object symbols waring in log than you got actual file which is overlap in code.

查看更多
贼婆χ
7楼-- · 2019-01-04 02:51

This issue could be because some libraries might be missing. Right click on the error line and click on "Open these results as transcript text files" and check the missing library.

查看更多
登录 后发表回答