• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: newbie question: tangential compiler errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie question: tangential compiler errors


  • Subject: Re: newbie question: tangential compiler errors
  • From: Chris Hanson <email@hidden>
  • Date: Mon, 13 Oct 2008 20:07:44 -0700

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


  • Follow-Ups:
    • Re: newbie question: tangential compiler errors
      • From: JB <email@hidden>
References: 
 >newbie question: tangential compiler errors (From: JB <email@hidden>)

  • Prev by Date: Re: newbie question: tangential compiler errors
  • Next by Date: Re: NSCollectionView - getting notified of selection change?
  • Previous by thread: Re: newbie question: tangential compiler errors
  • Next by thread: Re: newbie question: tangential compiler errors
  • Index(es):
    • Date
    • Thread