views:

15680

answers:

8

Hi,

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?

+3  A: 

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.

Aviad Ben Dov
+1  A: 

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

Dave Verwer
+2  A: 

Hi, 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!

SKayser
A: 

you have defined the same static constants!!!! static NSString *kSectionTitleKey = @"sectionTitleKey"; static NSString *kSectionTitleKey = @"sectionTitleKey";


the problem is

nothing about the CoreGraphics.framework

vivian
What `kSectionTitleKey`? What are you refering to?
sth
我英文不好,就是你定义了相同的静态常量. You defined the same static constants,This is the reason for the error!
vivian
did you konw how to save pictures from one of my Application to PhotoLibrary?
vivian
UIImage *imageSave = [UIImage imageNamed:@"1.jpg" ]; UIImageWriteToSavedPhotosAlbum(imageSave, nil, nil, nil);I have known
vivian
A: 

I have same problem,I found the reason is,I worte two "int main(int argc, char *argv[])" function.

xiaogong
+3  A: 

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.

Apoorv
A: 

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!!!

Albert
A: 

My gcc also failed with exit code 1 when try to compile Molecules when precompile Molecules_Prefix.pch

//
// Prefix header for all source files of the 'PortaMol' target in the 'PortaMol' project
//

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif

The build result give no further information. What can I do to diagnosis this compiling problem?

James