Problems during installing ROOT with OpenGL (SUSE 10.1)

Hi there;

I tried to install ROOT 5.14 with OpenGL-Support on Linux SUSE10.1.
When I type:

./configure --enable-opengl --with-opengl-incdir=/…PATH…/Mesa/include --with-opengl-libdir=/…PATH…/Mesa/lib

everything still seems to be ok,
but when typing “make”, I get the following errors:

gl/src/TGLScene.cxx: In member function ‘void TGLScene::Draw(const TGLCamera&, TGLDrawFlags, Double_t, Int_t, const TGLVertex3*, Bool_t)’:
gl/src/TGLScene.cxx:530: error: invalid conversion from ‘unsigned int’ to ‘GLenum’
gl/src/TGLScene.cxx:530: error: initializing argument 1 of ‘void glClipPlane(GLenum, const GLdouble*)’
gl/src/TGLScene.cxx:531: error: invalid conversion from ‘unsigned int’ to ‘GLenum’
gl/src/TGLScene.cxx:531: error: initializing argument 1 of ‘void glEnable(GLenum)’
gl/src/TGLScene.cxx:543: error: invalid conversion from ‘unsigned int’ to ‘GLenum’
gl/src/TGLScene.cxx:543: error: initializing argument 1 of ‘void glClipPlane(GLenum, const GLdouble*)’
gl/src/TGLScene.cxx:546: error: invalid conversion from ‘unsigned int’ to ‘GLenum’
gl/src/TGLScene.cxx:546: error: initializing argument 1 of ‘void glClipPlane(GLenum, const GLdouble*)’
gl/src/TGLScene.cxx:547: error: invalid conversion from ‘unsigned int’ to ‘GLenum’
gl/src/TGLScene.cxx:547: error: initializing argument 1 of ‘void glEnable(GLenum)’
gl/src/TGLScene.cxx:556: error: invalid conversion from ‘unsigned int’ to ‘GLenum’
gl/src/TGLScene.cxx:556: error: initializing argument 1 of ‘void glDisable(GLenum)’
make: *** [gl/src/TGLScene.o] Fehler 1

what does this mean ?

regards;
asim.

Hi. This means ill-formed C++ programm :slight_smile:)
On your platform with your headers GLenum must be something different from simple int type, so it requires explicit cast.
What if you (in lines mentioned in diagnosit ) replace GL_CLIP_PLANE0+i with GLenum(GL_CLIP_PLANE0+i) ?

We’ll fix it in CVS ASAP.

Hi.
I changed the code as you proposed.
I get the same result :frowning:

Thanks anyway;
Asim.

[quote=“Akrasim”]Hi.
Asim.[/quote]

Sorry, I don’t beleive you. Have you done these changes ?

TGLScene::Draw, line 533:

glClipPlane(GLenum(GL_CLIP_PLANE0 + i), planeSet[i].CArr());
glEnable(GLenum(GL_CLIP_PLANE0 + i));

line 545:

glClipPlane(GLenum(GL_CLIP_PLANE0+planeInd - 1), activePlanes[planeInd - 1].CArr());

line 549:

glClipPlane(GLenum(GL_CLIP_PLANE0+planeInd), activePlanes[planeInd].CArr());
glEnable(GLenum(GL_CLIP_PLANE0+planeInd));

line 558:

glDisable(GLenum(GL_CLIP_PLANE0 + planeInd));

My line numbers are slightly different from yours, but it doesn’t matter,
you can simply find these lines.

If you still have errors, can you, please, show diagnostic and find out what is GLenum in your gl.h ?

Hi.

Sorry, the problem seems to be solved.
I had two gl.h - files in my system and picked out the wrong one.

So, there was:

typedef int GLenum;

instead of

typedef unsigned int GLenum;

I haven’t tested the OpenGL-funktions yet, but I didn’t get no more errors when compiling.
So, thanks again.

Asim.

Unsigned int (the result of expression GL_CLIP_PLANE0 + i) can be implicitly converted into signed int and this will not cause compiler error you had.

I’ afraid, you are right.

I tried to start “ROOT seen by TGeo”,
with

top->Draw(“ogl”);

as last line.

Unfortunately, only the pad opens, and I get the following error:

Warning in TCanvas::TPad::CreateViewer3D: Cannot create 3D viewer of type: ogl

Well, this is already the fourth problem in this discussion:

  1. The first - errors in TGLScene (they are really errors if GLenum is enum and not a typedef for unsigned int or int).
  2. You say that you cannot compile even with modifications in code - though it’s impossible, if you did them as I had explained.
  3. You told that you have 2 different gl headers. But both of them have GLenum as typedef for some integer type, so it cannot be a reason.
  4. Now you cannot start some ROOT’s geometry.

Let’s start from the beginning.

  1. Do you have libRGL in your $ROOTSYS/lib now?
  2. If not - make the changes I’ve suggested today, re-configure ROOT,
    check that you have OpenGL enabled and re-compile.

Hello;

during the weekend, I deleted the old ROOT-Installation, unzipped the files once more and re-did the code-modifications you suggested.
So, I now do have libRGL in %ROOTSYS/lib,
when trying to start “ROOT seen by TGeo”, the OpenGL-viewers appears.

Unfortunately there are errors now, which are even more ugly than the last ones :frowning:

But thanks for your support so far.

I’ve attached the code of “ROOT seen by TGeo” as well as the errors I got.
Maybe you know what the mean.

Asim.
test.txt (5.22 KB)
errors.txt (5.79 KB)

Edit:

I should mention, that there are no volumes displayed, although the OpenGL-viewer appears. Only the viewer itself with a black screen.

I’ve just changed Draw(“ogl”) to Draw(“x3d”) - everything workes, same with the pad.
when I choose View -> View with -> OpenGL , I get again
Break segmentation violation
and all the errors saved in the attached file.
My gl.h is version 6.3 by the way (i read about crushes in earlier root-versions)

Are there any ideas what else I could check ?

Thanks;
Asim.