First, when supplying code or output, please use triple-back-accent (``` on a separate line), then the code/output, terminated by another ```. Or an attachment. Not an screenshot.
Mmm. Seems you are using an old version of G4VisExecutive.icc. Do you have your own copy? Should not be needed. In your main program file:
#include "G4VisExecutive.hh"
should be enough. It includes G4VisExecutive.icc from the geant4 source tree.
At least, that’s how it looks. Let us know if this is a misdiagnosis.
Thank you for your remark, John. Yes, indeed, "G4VisExecutive.hh" is included in the main file.
/// \file exampleB2b.cc
/// \brief Main program of the B2b example
#include "DetectorConstruction.hh"
#include "ActionInitialization.hh"
#include "G4RunManagerFactory.hh"
#include "G4SteppingVerbose.hh"
#include "G4UImanager.hh"
#include "FTFP_BERT.hh"
#include "G4StepLimiterPhysics.hh"
#include "Randomize.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
int main(int argc,char** argv)
{
Additionally, I’ve tested with another extended example (Hadr04). Here’s the output:
(G4-Ayoub) mlahdour@ThinkCentre:~/Bureau/Ayoub/software/geant4-v11.2.1-install/share/Geant4/examples/extended/hadronic/Hadr04/build$ ./Hadr04
Available UI session types: [ tcsh, csh ]
**********************
Geant4 version Name: geant4-11-01-patch-02 [MT] (15-June-2023)
<< in Multi-threaded mode >>
Copyright : Geant4 Collaboration
References : NIM A 506 (2003), 250-303
: IEEE-TNS 53 (2006), 270-278
: NIM A 835 (2016), 186-225
WWW : http://geant4.org/
**********************
Visualization Manager instantiating with verbosity "warnings (3)"...
Visualization Manager initialising...
Registering graphics systems...
You have successfully registered the following graphics systems.
Registered graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
TOOLSSG_OFFSCREEN (TSG_OFFSCREEN)
TOOLSSG_OFFSCREEN (TSG_OFFSCREEN, TSG_FILE)
Registering model factories...
You have successfully registered the following model factories.
Registered model factories:
generic
drawByAttribute
drawByCharge
drawByOriginVolume
drawByParticleID
drawByEncounteredVolume
Registered models:
None
Registered filter factories:
attributeFilter
chargeFilter
originVolumeFilter
particleFilter
encounteredVolumeFilter
Registered filters:
None
You have successfully registered the following user vis actions.
Run Duration User Vis Actions: none
End of Event User Vis Actions: none
End of Run User Vis Actions: none
Some /vis commands (optionally) take a string to specify colour.
"/vis/list" to see available colours.
PreInit>
when I run cmake …, it indicates that Geant4 version 11.1.2 is found, even though I’m working with version 11.2.1.
(base) mlahdour@ThinkCentre:~/Bureau/Ayoub/software/geant4-v11.2.1-install/share/Geant4/examples/basic/B3/B3a/build$ cmake ..
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found EXPAT: /usr/lib/x86_64-linux-gnu/libexpat.so (found suitable version "2.4.7", minimum required is "2.4.7")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Geant4: /usr/local/lib/cmake/Geant4/Geant4Config.cmake (found version "11.1.2")
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/mlahdour/Bureau/Ayoub/software/geant4-v11.2.1-install/share/Geant4/examples/basic/B3/B3a/build
That certainly explains it. Of course, one must compile and link with the correct Geant4 code and libraries. Do you know how to do this? Can you correct the above problem yourself? (Have a look at the Installation Guide.) Let us know if it fixes things for you.