Re: to include a C++ class in proj
Re: to include a C++ class in proj
- Subject: Re: to include a C++ class in proj
- From: Jens Miltner <email@hidden>
- Date: Thu, 27 Mar 2008 14:58:47 +0100
Am 27.03.2008 um 14:44 schrieb Nick Rogers:
are we allowed to do that in a cocoa proj.
if so how do we declare the class.
Is it like?
class MyClass
{
}
this is throwing error at the first line: parse error before
'MyClass' token
what headers do i need to include for a C++ class?
Make sure your source file is compiled as Objective-C++. The easiest
way is to give the file a '.mm' extension. Alternatively, you can
change the file type in the inspector panel for the source file, but I
prefer to indicate the language by file extension - it saves me a lot
of headaches why things work different than expected ;-)
Also, your declaration above is missing a trailing semicolon - I guess
that's not the issue here, but I have seen strange apparently out-of-
location error messages when gcc gets confused due to missing
semicolons...
HTH,
</jum>
_______________________________________________
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