I had an application that was all in C++
I wanted to call some ObjectiveC methods from the C++ code.
So I renamed the C++ code from .cpp to .mm
I built the application and it build without any problems.
As a test I added a new ObjectiveC class to the project.
this is first.h
#im****t <Cocoa/Cocoa.h>
@[EMAIL PROTECTED]
first1 : NSObject {
}
- (int) test;
@[EMAIL PROTECTED]
first.mm
#im****t "first1.h"
@[EMAIL PROTECTED]
first1
- (int) test
{
return 1;
}
@[EMAIL PROTECTED]
my application in one of the C++ methods i did this:
#im****t <first1.h>
void MyMethod(void)
{
first1 *x = [[first1 alloc] init];
int y = [x test];
y = y - 1;
}
I built the application and get some link errors...
Tool:0: internal link edit command failed
Tool:0: /Users/brianobrien/Desktop/development/Real Basic/plugins/
first/build/first.build/Development/first PPC.build/Objects-normal/ppc/
first.o reference to undefined _objc_msgSend
Tool:0: /Users/brianobrien/Desktop/development/Real Basic/plugins/
first/build/first.build/Development/first PPC.build/Objects-normal/ppc/
first.o reference to undefined .objc_class_name_first1
Tool:0: NEXT_ROOT environment variable ignored because -syslibroot
specified
Tool:0: .objc_class_name_first1
Tool:0: Undefined symbols:
Tool:0: warning prebinding disabled because of undefined symbols
Tool:0: _objc_msgSend
Does anyone know what I've done wrong?
Should I be linking with some library that I'm not?