• 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: Using C++ classes from Objective C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using C++ classes from Objective C


  • Subject: Re: Using C++ classes from Objective C
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 19 Mar 2008 15:22:41 -0700


On 19 Mar '08, at 1:12 PM, Jeremy wrote:

I then changed my .m file to a .mm file and all of the errors went away except for one:
"cannot find interface declaration for 'MyClass'"


The code in my .mm file is as such:

m_pMemberVariable = new MyClass();
const unsigned int nRes = m_pMemberVariable->MyFunc();

The second line gets the error. The new allocation in the first line seems to compile fine.

I think there's something wrong with the declaration of m_pMemberVariable in the matching .h file. What does it look like? It should be something like:


class MyClass;

@interface MyObjCClass : NSObject {
	MyClass *m_pMemberVariable;
}
...
@end

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Using C++ classes from Objective C (From: Jeremy <email@hidden>)

  • Prev by Date: Re: Correct procedure for safely swapping a text storage?
  • Next by Date: populate a custom sub-class with data from bindings
  • Previous by thread: Re: Using C++ classes from Objective C
  • Next by thread: Re: Using C++ classes from Objective C
  • Index(es):
    • Date
    • Thread