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条回答
倾城 Initia
2楼-- · 2019-01-04 03:01

Evans answer is the best thing you can do to find the exact reason of why you are having that error. In most cases, in my experience, is that there have been files that have been deleted but haven't been removed from the project.

查看更多
何必那么认真
3楼-- · 2019-01-04 03:03

You probably don't have the CoreGraphics.framework added to your frameworks list.

To make sure, click the "Frameworks" folder on Xcode. If the framework isn't listed on the table to the right, you'll need to add it by right-clicking the Frameworks folder, chooseing "Add Existing Framework..." and then choosing it from the list.

查看更多
狗以群分
4楼-- · 2019-01-04 03:05

Another fix to this problem that was the answer to my fix was that I had two classes with the same name. A webservices helper had created an Invoice class, and when I tried to add a file with that same name it didn't have any problems until I tried to compile.

So make sure all your classes have unique names :)

查看更多
我想做一个坏孩纸
5楼-- · 2019-01-04 03:08

When u create a file , u have to disable [uncheck] cocos2d libraries & then add the file. so that gcc-4.2 error will be rectified :) checkout!!!

查看更多
霸刀☆藐视天下
6楼-- · 2019-01-04 03:08

I had the same problem. The reason was, I had two int main(int argc, char *argv[]) functions.

查看更多
聊天终结者
7楼-- · 2019-01-04 03:11

As you can see from the many different responses this error is caused by many different problems. Luckily, I have found the Meta Solution!

In xcode, right click the error line and choose "Open These Latest Results as Transcript Text File". This will open the real xcode output log, which should contain a better description of the error then was previously seen.

-Evan

查看更多
登录 后发表回答