Skip navigation.
 
mlRe: Using C++ classes from Objective C
FROM : Jens Alfke
DATE : Wed Mar 19 23:22:41 2008

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

Related mailsAuthorDate
mlUsing C++ classes from Objective C Jeremy Mar 19, 21:12
mlRe: Using C++ classes from Objective C John Stiles Mar 19, 21:22
mlRe: Using C++ classes from Objective C Jeremy Mar 19, 21:32
mlRe: Using C++ classes from Objective C Jens Alfke Mar 19, 23:22
mlRe: Using C++ classes from Objective C Rob Napier Mar 20, 16:11
mlRe: Using C++ classes from Objective C John Stiles Mar 20, 17:32
mlRe: Using C++ classes from Objective C Jeremy Mar 20, 17:40
mlRe: Using C++ classes from Objective C John Stiles Mar 20, 18:07
mlRe: Using C++ classes from Objective C Chris Meyer Mar 20, 18:11
mlRe: Using C++ classes from Objective C Rob Napier Mar 20, 18:32
mlRe: Using C++ classes from Objective C Christopher Nebel Mar 20, 19:33
mlRe: Using C++ classes from Objective C Clark Cox Mar 20, 20:13
mlRe: Using C++ classes from Objective C Jeremy Mar 20, 20:34
mlRe: Using C++ classes from Objective C Jeff LaMarche Mar 20, 21:05
mlRe: Using C++ classes from Objective C Rob Napier Mar 20, 21:20
mlRe: Using C++ classes from Objective C Scott Thompson Mar 21, 03:57