Please Help: Objective-C++ / C++ mix and public inheritance
Please Help: Objective-C++ / C++ mix and public inheritance
- Subject: Please Help: Objective-C++ / C++ mix and public inheritance
- From: Jesse Thompson <email@hidden>
- Date: Sun, 4 Jul 2004 17:34:01 -0700
I'm a CS student and am currently taking a computer graphics course.
Our term project can be written in C or C++, but I've chosen C++
because I *need* to be able to create objects. I've decided to write a
GUI front-end in Cocoa / Objective-C++, and my professor said that
that would be fine as long as the GUI is the only thing written in
Objective-C++.
Okay, don't want to waste anymore of your time so I'll get right into
it. For some odd reason, inheritance in my C++ classes works just
fine, as long as I don't try to inherit anything protected. For
example:
class A {
public:
A();
protected:
int blah;
};
class B : public A {
public:
B( blah = 1; }
};
Now this works just fine if I don't #include the cocoa libraries from
within main.mm, but I *have* to #import <Cocoa/Cocoa.h> for return
NSApplicationMain(argc, ( const char **)argv); to work. Is this a bug
in Cocoa / Objective-C++, or is there something I"m missing. Also, in
referring to the above example, if <blah> is public, then it works
just fine... Can't seem to figure it out.
Thanks for your help and time.
Jesse Thompson
_______________________________________________
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.