Hi, I run into a small issue while compiling Geant 4.9.5.p01 with libqt 4.8.1. I belive the root of the problem is in /source/visualization/OpenGL/include/G4OpenGL.hh. Since QT version 4.8.0 GL/glu.h is not included anymore in qgl.h (http://qt.gitorious.org/qt/qt/blobs/4.8/dist/changes-4.8.0, line 153), causing the following compliation error: /home/bvelghe/geant4.9.5.p01/source/visualization/OpenGL/src/G4OpenGLViewer.cc: In member function ‘virtual void G4OpenGLViewer::SetView()’: /home/bvelghe/geant4.9.5.p01/source/visualization/OpenGL/src/G4OpenGLViewer.cc:295:47: error: ‘gluLookAt’ was not declared in this scope /home/bvelghe/geant4.9.5.p01/source/visualization/OpenGL/src/G4OpenGLViewer.cc: In member function ‘void G4OpenGLViewer::Pick(GLdouble, GLdouble)’: /home/bvelghe/geant4.9.5.p01/source/visualization/OpenGL/src/G4OpenGLViewer.cc:426:53: error: ‘gluPickMatrix’ was not declared in this scope /home/bvelghe/geant4.9.5.p01/source/externals/clhep/include/CLHEP/Units/PhysicalConstants.h: At global scope: /home/bvelghe/geant4.9.5.p01/source/externals/clhep/include/CLHEP/Units/PhysicalConstants.h:79:21: warning: ‘CLHEP::electron_charge’ defined but not used [-Wunused-variable] make[2]: *** [source/visualization/OpenGL/CMakeFiles/G4OpenGL.dir/src/G4OpenGLViewer.cc.o] Error 1 make[1]: *** [source/visualization/OpenGL/CMakeFiles/G4OpenGL.dir/all] Error 2 make: *** [all] Error 2 The quick and dirty fix consist in adding #include <GL/glu.h> in the bloc G4VIS_BUILD_OPENGLQT_DRIVER Cheers, Bob
Hi bob, What is your configuration and system version ? Cheers, Laurent (In reply to comment #0) > Hi, > > I run into a small issue while compiling Geant 4.9.5.p01 with libqt 4.8.1. > > I belive the root of the problem is in > /source/visualization/OpenGL/include/G4OpenGL.hh. Since QT version 4.8.0 > GL/glu.h is not included anymore in qgl.h > (http://qt.gitorious.org/qt/qt/blobs/4.8/dist/changes-4.8.0, line 153), causing > the following compliation error: > > /home/bvelghe/geant4.9.5.p01/source/visualization/OpenGL/src/G4OpenGLViewer.cc: > In member function ‘virtual void G4OpenGLViewer::SetView()’: > /home/bvelghe/geant4.9.5.p01/source/visualization/OpenGL/src/G4OpenGLViewer.cc:295:47: > error: ‘gluLookAt’ was not declared in this scope > /home/bvelghe/geant4.9.5.p01/source/visualization/OpenGL/src/G4OpenGLViewer.cc: > In member function ‘void G4OpenGLViewer::Pick(GLdouble, GLdouble)’: > /home/bvelghe/geant4.9.5.p01/source/visualization/OpenGL/src/G4OpenGLViewer.cc:426:53: > error: ‘gluPickMatrix’ was not declared in this scope > /home/bvelghe/geant4.9.5.p01/source/externals/clhep/include/CLHEP/Units/PhysicalConstants.h: > At global scope: > /home/bvelghe/geant4.9.5.p01/source/externals/clhep/include/CLHEP/Units/PhysicalConstants.h:79:21: > warning: ‘CLHEP::electron_charge’ defined but not used [-Wunused-variable] > make[2]: *** > [source/visualization/OpenGL/CMakeFiles/G4OpenGL.dir/src/G4OpenGLViewer.cc.o] > Error 1 > make[1]: *** [source/visualization/OpenGL/CMakeFiles/G4OpenGL.dir/all] Error 2 > make: *** [all] Error 2 > > The quick and dirty fix consist in adding #include <GL/glu.h> in the bloc > G4VIS_BUILD_OPENGLQT_DRIVER > > Cheers, > > Bob
I can confirm this on Archlinux 64 bit, Qt 4.8.5 and Geant4.10.00.b01: /home/mori/software/source/geant4.10.00.b01/source/visualization/OpenGL/src/G4OpenGLViewer.cc: In member function ‘void G4OpenGLViewer::Pick(GLdouble, GLdouble)’: /home/mori/software/source/geant4.10.00.b01/source/visualization/OpenGL/src/G4OpenGLViewer.cc:428:53: error: ‘gluPickMatrix’ was not declared in this scope gluPickMatrix(x, viewport[3] - y, 5., 5., viewport); ^ It seems to be a long-standing issue; a working hack is described here: http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1531/1/1/1.html but modifying the Qt header is not a satisfactory solution and a fix within the Geant4 code would be appreciated.
Hi, Sorry for the delay. I think that your problem was the same as here : http://hypernews.slac.stanford.edu/HyperNews/geant4/get/installconfig/1638.html A patch for Geant4 (since Geant4.10.1) on Linux will consist in building Geant4 adding -DGEANT4_USE_OPENGL_X11=ON. This will be fixed in next Geant4 version. Cheers,