Re: C++ structs in .mm file
Re: C++ structs in .mm file
- Subject: Re: C++ structs in .mm file
- From: "GM Lopes" <email@hidden>
- Date: Wed, 26 May 2004 18:55:31 +0000
Does anybody have some hints, what to do? Maybe I'm just missing some
compilator flag or smth?
Here's about as simple an example as it gets. I created a new project as a
Cocoa Application, then added one Objective-C class called mmtest.mm. (It
also builds OK if I move the struct definition into its own header.)
// ** HEADER FILE ** mmtest.h
#import <Cocoa/Cocoa.h>
struct mmtesting {
int data;
};
@interface mmtest : NSObject {
}
- (void) doSomething;
@end
// ** IMPLEMENTATION FILE ** mmtest.mm
#import "mmtest.h"
@implementation mmtest
- (void) doSomething
{
struct mmtesting *mm = new mmtesting();
delete mm;
}
@end
........................
Thank you for your example. However, it doesn't help me much. I have used
C++ mixed with Objective-C successfully before. But now I have this strange
compilation problem with just one header file, which compiles fine when
included in a cpp file. I have no idea why it fails in mm files. Maybe
somebody has experienced something similar?
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
_______________________________________________
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.