Cvs build prob with gl on RH7.2

Hi,
I ran into a problem building Sunday’s cvs root on a RH7.2 machine, see appended build output. For some reason it doesn’t pick up

typedef GLUtesselator GLUtriangulatorObj;

from GL/glu.h, probably because the #if defined GLU_VERSION_1_2 is skipped.

Any suggestions what I can do to fix that?
Axel.

-------- Original Message --------
g++ -g -pipe -Wall -W -Woverloaded-virtual -fPIC -Iinclude -pthread -Iinclude -o gl/src/TGLKernel.o -c gl/src/TGLKernel.cxx
gl/src/TGLKernel.cxx: In member function virtual GLUtesselator* TGLKernel::GLUNewTess() const': gl/src/TGLKernel.cxx:1074: cannot convertGLUtriangulatorObj*’ to GLUtesselator*' in return gl/src/TGLKernel.cxx: In member functionvirtual void
TGLKernel::GLUDeleteTess(GLUtesselator*) const’:
gl/src/TGLKernel.cxx:1079: cannot convert GLUtesselator*' to
GLUtriangulatorObj*’ for argument 1' tovoid
gluDeleteTess(GLUtriangulatorObj*)‘
gl/src/TGLKernel.cxx: In member function virtual void TGLKernel::GLUTessCallback(GLUtesselator*) const': gl/src/TGLKernel.cxx:1085: cannot convertGLUtesselator*’ to GLUtriangulatorObj*' for argument1’ to void gluTessCallback(GLUtriangulatorObj*, unsigned int, void (*)())' gl/src/TGLKernel.cxx:1086: cannot convertGLUtesselator*’ to GLUtriangulatorObj*' for argument1’ to void gluTessCallback(GLUtriangulatorObj*, unsigned int, void (*)())' gl/src/TGLKernel.cxx:1087: cannot convertGLUtesselator*’ to GLUtriangulatorObj*' for argument1’ to void gluTessCallback(GLUtriangulatorObj*, unsigned int, void (*)())' gl/src/TGLKernel.cxx: In member functionvirtual void
TGLKernel::GLUNextContour(GLUtesselator*) const’:
gl/src/TGLKernel.cxx:1092: cannot convert GLUtesselator*' to
GLUtriangulatorObj*’ for argument 1' tovoid
gluNextContour(GLUtriangulatorObj*, unsigned int)‘
gl/src/TGLKernel.cxx: In member function virtual void TGLKernel::GLUBeginPolygon(GLUtesselator*) const': gl/src/TGLKernel.cxx:1097: cannot convertGLUtesselator*’ to GLUtriangulatorObj*' for argument1’ to void gluBeginPolygon(GLUtriangulatorObj*)' gl/src/TGLKernel.cxx: In member functionvirtual void
TGLKernel::GLUEndPolygon(GLUtesselator*) const’:
gl/src/TGLKernel.cxx:1102: cannot convert GLUtesselator*' to
GLUtriangulatorObj*’ for argument 1' tovoid
gluEndPolygon(GLUtriangulatorObj*)‘
gl/src/TGLKernel.cxx: In member function virtual void TGLKernel::GLUTessVertex(GLUtesselator*, const Double_t*) const': gl/src/TGLKernel.cxx:1107: cannot convertGLUtesselator*’ to GLUtriangulatorObj*' for argument1’ to `void
gluTessVertex(GLUtriangulatorObj*, GLdouble*, void*)'
gmake: *** [gl/src/TGLKernel.o] Error 1
gmake: *** Waiting for unfinished jobs…

Hi Axel,
we are working on new version of GL interface.
Must be done today.

Regards. Valeriy

Hello.

In my GL/glu.h i have:

#ifdef __cplusplus
class GLUtesselator;
#else
typedef struct GLUTesselator GLUtesselator;
#endif

and later

typedef GLUtesselator GLUtesselatorObj;
typedef GLUtesselator GLUtriangulatorObj;

Cna you, please, show fragment from your header?

Here you go:

/*
 * Mesa 3-D graphics library
 * Version:  3.3
 * Copyright (C) 1995-2000  Brian Paul
...
#if defined(__BEOS__)
    /* The BeOS does something funky and makes these typedefs in one
     * of its system headers.
     */
#else

#if defined GLU_VERSION_1_2
    typedef struct GLUquadric GLUquadricObj;
    typedef struct GLUnurbs GLUnurbsObj;
    /* FIXME: We need to implement the other 1.3 typedefs - GH */
    typedef struct GLUtesselator GLUtesselator;
    typedef GLUtesselator GLUtriangulatorObj;
#else
    /* GLU 1.1 and older */
    typedef struct GLUquadric GLUquadricObj;
    typedef struct GLUtriangulatorObj GLUtriangulatorObj;
    typedef struct GLUnurbs GLUnurbsObj;
#endif

#endif

Axel.

Ok, thanks. I think, that we can fix it in this way :

in TVirtualGL.h you can see something like

struct GLUtesselator; //really, it must be extern “C” struct GLUtesselator, but someone remove extern “C” :frowning:((

and member-function declarations

GLUtesselator * GLUNewTess();

If your version of GLU is old, there is no GLUtesselator definition - we have incomplete type, but it is not so bad, we can do the following :

//in TGLkernel.cxx

GLUtesselator * TGLKernel::GLUNewTess()
{
//conversion to incomplete type is possible using C-style cast, not
//static_cast
return (GLUtesselator *)gluNewTess();
}

the same conversions are in all places.

please, can you try it?

Hi,
it still doesn’t build, even after the recent changes to GL in cvs. As tpochep pointed out, an explicit cast is needed. Not only for the return values, but also for the calls to gluTessCallback etc.
Axel.

[quote=“Axel”]Hi,
it still doesn’t build, even after the recent changes to GL in cvs.

Hmmm, It’s very strange.

As tpochep pointed out, an explicit cast is needed. Not only for the return values, but also for the calls to gluTessCallback etc.

Yes, I’ve added them in all places, but I cannot check, if it’s compilable now. did you secceed in compiling with this explicit casts?