Mixing C++ and Objective-C
Mixing C++ and Objective-C
- Subject: Mixing C++ and Objective-C
- From: Steve Wart <email@hidden>
- Date: Sat, 7 Feb 2009 12:29:25 -0800
I am trying to build an application that uses some C++ classes, based on
Apple's example Cocoa OpenGL application here:
http://developer.apple.com/samplecode/CocoaGL/index.html#//apple_ref/doc/uid/DTS10004501
It works fine in 10.5.6 with XCode 3.1 if I change the file type of
BasicOpenGLView.m to sourcecode.cpp.objcpp. But if I then add the following
to the definitions prior to the @implementation:
class Vector3d {
double x, y, z;
};
class CameraFrame {
public:
Vector3d origin;
};
I get a number of errors linking to the C functions in GLCheck.c. Is there a
subtle issue I am missing or am I going about this completely the wrong way?
Steve
"HaveOpenGLCapsChanged(GLCaps*, unsigned int)", referenced from:
getCurrentCaps() in BasicOpenGLView.o
"initCapsTexture(GLCaps*, unsigned int)", referenced from:
getCurrentCaps() in BasicOpenGLView.o
"drawCaps(GLCaps*, unsigned int, long, float)", referenced from:
-[BasicOpenGLView drawInfo] in BasicOpenGLView.o
"CheckOpenGLCaps(unsigned int, GLCaps*, unsigned int*)", referenced from:
getCurrentCaps() in BasicOpenGLView.o
getCurrentCaps() in BasicOpenGLView.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
_______________________________________________
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