Re: newbie question: tangential compiler errors
Re: newbie question: tangential compiler errors
- Subject: Re: newbie question: tangential compiler errors
- From: JB <email@hidden>
- Date: Wed, 15 Oct 2008 09:04:12 -0700
I unchecked "Precompile Prefix Header" in the new target's build settings
(per Chris's comments) and it compiles without error now.
Thanks!
JB
On Mon, Oct 13, 2008 at 8:07 PM, Chris Hanson <email@hidden> wrote:
> On Oct 13, 2008, at 12:42 PM, JB wrote:
>
> I've added Apple's sample LoginItemsAE class to autolaunch an app I've
>> built
>> for Tiger and Leopard. However, the app fails to compile when I add
>> "LoginItemsAE.c" to the app target, throwing over 3000 "syntax" and
>> "conflicting types" errors here:
>>
>> AppKit.h > Foundation.h > NSObjCRuntime.h
>>
>
> You're probably doing this in a new target, which (due to limitations of
> how Xcode creates new targets from templates) has AppKit.h set as its prefix
> header.
>
> Using AppKit.h (which is Objective-C) as a prefix header doesn't guard
> against inclusion in plain C or C++ source files, unfortunately. You'll
> have to switch the target's prefix header to a local prefix that includes an
> #ifdef __OBJC__/#endif around the #import of <Cocoa/Cocoa.h>, one of which
> was probably created for you when you created the project.
>
> -- Chris
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden