Re: Compile errors in PCH on Mac OS X project
Re: Compile errors in PCH on Mac OS X project
- Subject: Re: Compile errors in PCH on Mac OS X project
- From: Robert Tillyard <email@hidden>
- Date: Thu, 31 May 2012 23:04:38 +0100
Hello, Jens,
My .pch file is:
// // Prefix header for all source files of the 'CD3' target in the 'CD3' project //
#ifdef __OBJC__ #import <Cocoa/Cocoa.h> #endif
But I do have C files in the project. I tried removing them but the build fails in the same place.
Regards, Rob.
On 31 May 2012, at 22:24, Jens Alfke wrote: On May 31, 2012, at 1:18 PM, Robert Tillyard wrote: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreData.framework/Headers/NSPropertyDescription.h:23:2: error: unknown type name 'NSData' NSData *_versionHash;
I've seen stuff like this happen if your target contains plain C or C++ source files, and your prefix file unconditionally includes Objective-C headers like <Cocoa.h>. The prefix file is included by *all* source files, so a separate precompiled header will be generated for each language. And it's not going to be able to parse Obj-C if it's in C or C++ mode.
Make sure your prefix wraps Obj-C specific imports with "#ifdef __OBJC__".
—Jens
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden