Re: 'class' in .h file
Re: 'class' in .h file
- Subject: Re: 'class' in .h file
- From: Prachi Gauriar <email@hidden>
- Date: Sat, 22 Nov 2003 14:23:26 -0600
On Nov 22, 2003, at 1:52 PM, OL&L Dev 2 wrote:
A.mm for a header file?
This will also break the compile on older versions of CodeWarrior as
it maps .h to both C and C++ files and I need to leave it that was so
that I can compile it with CodeWarrior's C++ compiler also. This is a
.h file that I need to be able to compile on Classic, Carbon, and
Cocoa. Why can't the Obj-C compiler handle 'class' in a .h file?
-m
Because Objective-C is a superset of C, not C++. A Cocoa/Objective-C
application only allows for Objective-C by default. As such, to make
it use a C++ file, you need to let the compiler know that the file is
Objective-C++ so that the compiler can understands C++ and Objective C.
Don't change the name of the header. Just of the files that use the
header. Give them .mm extensions so that the compiler explicitly
understands that the files should be compiled as Objective-C++.
-Prachi
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.