Problem on running simulation in Geant4 version 11

I was using geant4 version 10.7 and recently changed to geant4 version 11.1.2. I was running the example B4a in geant4 and it was working just fine. After one run I used the command make clean to clean the build folder and gave the command to make and run the programme. Then the simulation gave an error message

./exampleB4a: symbol lookup error: ./exampleB4a: undefined symbol: _ZN12G4VisManager12DrawGeometryEP17G4VPhysicalVolumeRKN7HepGeom11Transform3DE

I then deleted the build folder and rebuild another build folder under a different name and tried to run the programme. Then the programme is giving a cascade of errors such as;

fatal error: G4AnalysisManager.hh: No such file or directory
   33 | #include "G4AnalysisManager.hh"
      |          ^~~~~~~~~~~~~~~~~~~~~~ error: ‘UseBestUnit’ is not a member of ‘G4SteppingVerbose’
  112 |     G4SteppingVerbose::UseBestUnit(precision);

Like this, I had to reboot the system multiple times and finally, the simulation started to work fine. But as I clean and re-run the simulation, again the above-mentioned errors are occurring. I have no idea why and how it happens. Thanks a lot in advance for the interest and help

_Geant4 Version:_11.1.2
_Operating System:_Ubuntu 22.04
_Compiler/Version:_gcc, cmake

If you are changing the Geant4 version, or want to build an application against several different versions, then a complete isolated build will be needed for each. That is, create a separate build directory for each, run CMake in that directory pointing it to the given Geant4 version and then build.

Rebooting the system will have zero effect on building either Geant4 or the application. You can double check that the build is compiling against/linking to the Geant4 install you expect with

make VERBOSE=1

for Makefiles, or

ninja -v

if the Ninja generator was used.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.