Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling without PCH #149

Merged
merged 1 commit into from Jun 11, 2012
Merged

Compiling without PCH #149

merged 1 commit into from Jun 11, 2012

Conversation

ndfred
Copy link
Contributor

@ndfred ndfred commented Jun 10, 2012

I've been using iCarousel with iOS 5.1 on the latest Xcode without PCH files (to get around Xcode syntax highlighting bugs) and it broke the build: the QuartzCore headers are included after the CGRect typedef is made, resulting in an unknown type name 'CGRect' error:

In file included from /Users/fred/Code/Teapot/cavemancey-ios/External/iCarousel/iCarousel/iCarousel.m:34:
/Users/fred/Code/Teapot/cavemancey-ios/External/iCarousel/iCarousel/iCarousel.h:96:9: error: unknown type name 'CGRect'
typedef CGRect NSRect;
        ^
/Users/fred/Code/Teapot/cavemancey-ios/External/iCarousel/iCarousel/iCarousel.h:97:9: error: unknown type name 'CGSize'
typedef CGSize NSSize;
        ^
/Users/fred/Code/Teapot/cavemancey-ios/External/iCarousel/iCarousel/iCarousel.m:219:38: error: sending 'NSRect' (aka 'int') to parameter of incompatible type 'CGRect' (aka 'struct CGRect'); 
    if ((self = [super initWithFrame:frame]))
                                     ^~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:140:29: note: passing argument to parameter 'frame' here
- (id)initWithFrame:(CGRect)frame;          // default initializer
                            ^
/Users/fred/Code/Teapot/cavemancey-ios/External/iCarousel/iCarousel/iCarousel.m:217:29: warning: conflicting parameter types in implementation of 'initWithFrame:': 'CGRect' (aka 'struct CGRect') vs 'NSRect' (aka 'int')
- (id)initWithFrame:(NSRect)frame
                     ~~~~~~ ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIView.h:140:29: note: previous definition is here
- (id)initWithFrame:(CGRect)frame;          // default initializer
                     ~~~~~~ ^

My fix just includes the QuartzCore headers a few lines earlier, which should be harmless and fix the bug.

By the way thanks for this great piece of software, saved me a couple days of work!

nicklockwood added a commit that referenced this pull request Jun 11, 2012
@nicklockwood nicklockwood merged commit 56fc96d into nicklockwood:master Jun 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants