On Dec 29, 2010, at 3:24 PM, Jason T. Slack-Moehrle wrote:

> Hello All,
> 
> I have a carbon app that I need to put some cocoa functionality in. I am 
> reading some resources on the ADC site.
> 
> In my .pch I am adding:
> 
> #ifdef __APPLE__ & __MACH__
>       #import <Cocoa/Cocoa.h>
>       #import <Foundation/Foundation.h>
>       #import <AppKit/AppKit.h>
> #endif
> 
> I have added the Cocoa and Foundation frameworks to my project, but when I 
> compile my .pch I get about 9761 errors right off the bat. 
> 
> I am obviously missing something key. What is it? 

What you're doing will not work when building C and C++ source code in that 
project, because those headers include ObjC definitions. If you do have C or 
C++ source code, then the easiest way to fix this is to use the preprocessor 
definition __OBJC__ rather than the two you are using above.

Also, if you are importing Cocoa, then you do not need to import or link to 
Foundation or AppKit or CoreData separately. All the Cocoa framework does is 
tie those three frameworks together.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to