• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C++ structs in .mm file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ structs in .mm file


  • Subject: Re: C++ structs in .mm file
  • From: Satyadeep Musuvathy <email@hidden>
  • Date: Wed, 26 May 2004 12:52:59 -0700

Something obvious, but if you are building from the command line, are you by any chance using gcc instead of g++ ?

Satya

On May 26, 2004, at 11:55 AM, GM Lopes wrote:

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.
_______________________________________________
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.


References: 
 >Re: C++ structs in .mm file (From: "GM Lopes" <email@hidden>)

  • Prev by Date: Re: Problem with NSOutlineView outlineView:willDisplayCell:forTableColumn:item: delegate method
  • Next by Date: Re: NSOutlineView, NSBrowserCell and Images
  • Previous by thread: Re: C++ structs in .mm file
  • Next by thread: Fwd: NSOutlineView, NSBrowserCell and Images
  • Index(es):
    • Date
    • Thread