Error compiling example B1 with make in Geant4-v10.7.3: error: 'UseBestUnit' is not a member of 'G4SteppingVerbose'


This issue was closed, but I have exactly the same problem.

I’m using a conda env with Geant4 v10.7.3.
I’m trying to compile with make the example B1 of the 10.7 release (here).

In my CMakeCache.txt in the build directory, I have

//The directory containing a CMake configuration file for Geant4.

as expected.

Indication: when trying to compile the example B1 of the v11.1 release (here) in a conda env containing Geant4 v11.0.3, it worked perfectly, and an executable is linked.

(for those who ask, I have a reason for trying to compile with v10, even though v11 is working perfectly).

Thank you in advance for your help!

Could you post the full output (attach it in a text file if it’s too large) of

$ make VERBOSE=1

please? The Geant4_DIR looks o.k., so the full compilation command is needed to check the exact error and what paths things are being picked up from.

Here it is!
outputMakeVerbose.txt (5.0 KB)

My conda environment is located at /

Thanks! I don’t think there’s an issue with the compilation/setting there, but the main file:


doesn’t appear to match that for the 10.7 release here: examples/basic/B1/ · geant4-10.7-release · geant4 / geant4 · GitLab.

The compilation error refers to line 59:

localscratch/girardcarillo/Workdir/Geant4/StartingKit/G4Examples_v10/examples/basic/B1/ error: 'UseBestUnit' is not a member of 'G4SteppingVerbose'
   59 |   G4SteppingVerbose::UseBestUnit(precision);
      |                      ^~~~~~~~~~~

but if you look at line 59 of the example for 10.7: examples/basic/B1/ · geant4-10.7-release · geant4 / geant4 · GitLab it’s just constructing a run manager, nothing about stepping verbose. That line only came in release 11: examples/basic/B1/ · geant4-11.0-release · geant4 / geant4 · GitLab

It therefore looks like you’re trying compile the example code written for Geant4 11 rather than the version for 10.7. How/where did you get the example code from?

Oh you’re totally right! I missed that!
I simply git cloned the master branch of the repo, and not the branch corresponding to the 10.7 release…

Thanks for your help, it was really efficient haha!!

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