Solved, thanks to the archives.

#ifdef __cplusplus
extern "C" {
#endif

extern CFunctionHere

#ifdef __cplusplus
}
#endif

Cheers,
Steve

On Sat, Feb 7, 2009 at 12:29 PM, Steve Wart <[email protected]> wrote:

> 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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to