Created attachment 511 [details] geant4 definitions visibility exercise Hello, I'm experiencing difficulties in usage geant4 visualization module to create my application (in particular in developing independent viewer, see: https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2075). I think that there is an issue related to cmake configuration and setting the c-preprocessor definitions... When I use the option -DGEANT4_USE_QT=ON then the GEANT4_USE_OPENGL is also set to ON. Afterwards it triggers adding new definition, namely G4VIS_BUILD_OPENGL_DRIVER, which is related to the code I want to use. It's super weird, because when I use standard visualization factories (like G4OpenGLStoredQtViewer) everything works well, but when I want to create my own and inherits from G4OpenGLStoredViewer I cannot see this class definition! I've tried to figure it out by checking the imported Geant4 definitions (in my CMakeLists.txt add_definitions(${Geant4_DEFINITIONS}) ), unfortunately I see only the following: -- Found Define: G4_STORE_TRAJECTORY -- Found Define: G4VERBOSE -- Found Define: G4UI_USE -- Found Define: G4VIS_USE -- Found Define: G4MULTITHREADED -- Found Define: G4UI_USE_TCSH -- Found Define: G4INTY_USE_QT -- Found Define: G4UI_USE_QT -- Found Define: G4VIS_USE_OPENGLQT -- Found Define: G4INTY_USE_XT -- Found Define: G4VIS_USE_OPENGLX -- Found Define: G4VIS_USE_OPENGL -- Found Define: G4_STORE_TRAJECTORY -- Found Define: G4VERBOSE -- Found Define: G4UI_USE -- Found Define: G4VIS_USE -- Found Define: G4MULTITHREADED -- Found Define: G4UI_USE_TCSH -- Found Define: G4INTY_USE_QT -- Found Define: G4UI_USE_QT -- Found Define: G4VIS_USE_OPENGLQT -- Found Define: G4INTY_USE_XT -- Found Define: G4VIS_USE_OPENGLX -- Found Define: G4VIS_USE_OPENGL Is that mean that the G4VIS_BUILD_OPENGL_DRIVER is private, or sth else? You can reproduce my problem by taking the attached exercise (there is simply main and CMakeLists.txt) I would really appreciate any suggestions how to figure it out. Am I doing wrong cmake configuration or something else? Best regards, Bartek Rachwal
The G4VIS_BUILD_OPENGL_DRIVER definition is private to the Geant4 build, so isn't (and worn't) be available to clients linking to the libraries. You can add it manually for this particular use case, but it's not a bug.