hi,
the semicolon is there. i've changed extension to .hh and .mm, still the same error. Again what headers to include for a .hh file to be taken as a file declaring a C++ class?

Wishes,
Nick

On 27-Mar-08, at 7:28 PM, Jens Miltner wrote:


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 (Cocoa-dev@lists.apple.com)

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