VC++ compiling gluTessCallBack

I have been trying to get the gluTessCallback functions to work with VC++ using the the example tess.c and moving to program tess.cpp
the tess.c program runs fine however when I
compile the same code snip in VC++ I get the following error

I have work with alot of OpenGL but fairly new with VC++ help!!!

‘gluTessCallback’ : cannot convert parameter 3 from ‘void (const double *)’ to ‘void (__stdcall *)(void)’
None of the functions with this name in scope match the target type
‘gluTessCallback’ : cannot convert parameter 3 from ‘void (unsigned int)’ to ‘void (__stdcall *)(void)’
None of the functions with this name in scope match the target type

Your error looks a bit strange but I’d say that it is a link error, isn’t it ? If it is, it’s because you forgot to link opengl32.lib to your project. If you don’t know how to do, ask me…
If it is a compilation error, I don’t know what is the reason…

Hi !

Your callback functions are C++ functions, not C functions, you need to use

extern “C” in front of your callback function definitions.

You may also need to do some type casting as C++ is much more picky about the types.

Mikael