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条回答
ゆ 、 Hurt°
2楼-- · 2019-01-04 02:54

I've found the problem after seeing the Build Results window that Dave mentioned (thank you!!!). I had a different version of the same .h and .m file because I was testing with different code. I deleted the unnecessary files as it was seeing something in there as a duplicate. The build was successful. Thank you!

查看更多
对你真心纯属浪费
3楼-- · 2019-01-04 02:54

I had the same problem, noticed that it was looking for a file in the wrong folder, essentially, don't store projects in folders with apostrophes in their name!

查看更多
姐就是有狂的资本
4楼-- · 2019-01-04 02:55

This problem also arises when you rename the XIB file. You have to replace the old name with the new name in the xib files as well as in the navigation controller (if used).

查看更多
孤傲高冷的网名
5楼-- · 2019-01-04 02:57

I have gone through that same problem. There may be some file which has no refference . You can see that type of file in red letter. Remove that file.

查看更多
姐就是有狂的资本
6楼-- · 2019-01-04 02:59

you have defined the same static constants!!!!

static NSString *kSectionTitleKey = @"sectionTitleKey";
static NSString *kSectionTitleKey = @"sectionTitleKey";

the problem is

nothing about the CoreGraphics.framework

查看更多
迷人小祖宗
7楼-- · 2019-01-04 02:59

xcode build errors:

 Unsupported compiler ‘GCC 4.2′ selected for architecture ‘i386′

Solution:

This can be caused by importing a project for a pre- iOS 5 SDK into a copy of xcode with iOS 5 SDK only.

To fix,

  click your Project -> Build Settings.  Then under Build Options, there is an entry for Compiler for C/C++/Objective-C.  Choose Apple LLVM compiler 3.0.
查看更多
登录 后发表回答