PDA

View Full Version : Compile error with OpenGL: How to set parameter compilation project QtCreator 2.6.0



giorgik
14th December 2012, 08:46
Hello to all. I have a project that uses calls to OpenGL, in particular, I'm:


static GLUtesselator *tobj = NULL;
tobj = gluNewTess();
gluTessCallback(tobj, GLU_TESS_VERTEX, (GLvoid (*) ()) &glVertex3dv);
...

compiling I get this error message:


C:\Qt\progetti\AreaRobot\blockgroup.cpp:187: error: invalid conversion from 'GLvoid (*)() {aka void (*)()}' to '_GLUfuncptr {aka void (*)()}' [-fpermissive]

I do not know how I can correct the error, can you help me ?

wysota
14th December 2012, 13:28
Remove the ampersand.

giorgik
14th December 2012, 19:27
thanks, now I try to see if it works

giorgik
16th December 2012, 11:59
The solution is this:

gluTessCallback(tobj, GLU_TESS_VERTEX, (void (__stdcall *)(void))glVertex3dv); ie:

(void (__stdcall *)(void))glVertex3dv