• 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
Referring to Other Classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Referring to Other Classes


  • Subject: Referring to Other Classes
  • From: email@hidden (Kris Rambish)
  • Date: Fri, 19 May 2006 22:28:52 +0000

Hi all,
  I am construction a framework using Objective-C++, basically an Objective-C wrapper for a C++ class.  I keep getting an error when I compile: cannot find interface declaration for <object1>

  What I have done is the following:

------------------------------------------------------------------------------------
wrapper.h

#import <Cocoa/Cocoa.h>
@class CpluspplusClass1, CpluspplusClass2;

@interface WrappedObject : NSObject
{
	CpluspplusClass1 *object1;
       CpluspplusClass2 *object2;
}
-(int) getValue;
-(int) DoSomethingAndReturn:(int)i;
@end

------------------------------------------------------------------------------------
wrapper.mm

#import "wrapper.h"
#import "cplusplusheader.h"

@implementation WrappedDSIRequest
-(int) getValue
{
    return object1->returnInt();      //This throws the error when I compile
}

-(int) DoSomethingAndReturn:(int)i
{
    return object2->DoCoolStoof(i);      //This throws the error when I compile
}
@end

------------------------------------------------------------------------------------

  Since I am building a framework I cannot move #import "cplusplusheader.h" into wrapper.h -- although that works.  Any ideas?

Thanks in advance,
Kris
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Referring to Other Classes
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Method with +
  • Next by Date: Re: Referring to Other Classes
  • Previous by thread: Re: Method with +
  • Next by thread: Re: Referring to Other Classes
  • Index(es):
    • Date
    • Thread