Problems with basic example B1 after installation

_Geant4 Version:_10.7.3
_Operating System:_Windows 10 Pro (Version 10.0.19045 Build 19045)
Microsoft (R) C/C+±Optimierungscompiler Version 19.37.32822 für x86
_CMake Version:_3.27.2
Visual Studio 2022

Hi everyone,

I’ve tried to install GEANT4 and run the basic example B1 by following this tutorial:

I’ve followed all the steps in the tutorial and it has worked fine. In the end, I selected exampleB1 in my visual studio project and clicked on “Set as Startup Project”. Then I clicked on “build” and it successfully created the exampleB1.exe. But when I try to run the exampleB1.exe, an error message appears and the terminal crashes.

error message:

Available UI session types: [ Win32, GAG, csh ]

-------- WWWW ------- G4Exception-START -------- WWWW -------

*** ExceptionHandler is not defined ***
*** G4Exception : UI0002
issued by : G4UIExecutive::G4UIExecutive()
Specified session type is not build in your system,
or no session type is specified.
A fallback session type is used.
*** This is just a warning message. ***
-------- WWWW ------- G4Exception-END -------- WWWW -------

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : PART70000
issued by : G4NuclideTable
G4ENSDFSTATEDATA environment variable must be set
*** Fatal Exception *** core dump ***

I’ve tried to the the environment variable with this:

set G4ENSDFSTATEDATA=C:/Users/Johannes/Geant4/program_files/share/Geant4-10.7.3/data/G4ENSDFSTATE

but it still didn’t run. Do you have any Ideas on how to fix this?
Many thanks in advance

Apologies for the delay in replying! The issue is that the tutorial you used is for Geant4 11.1, but you’re installing 10.7.3 which is prior to support for the GEANT4_DATA_DIR variable. You’re doing the right thing in setting the G4ENSDFSTATEDATA env var, but it’s likely the path will be:


Note the “2.3” on the end of the path - but confirm that directory exists locally. You’ll likely need to set the other env vars for other libraries as outlined in the official install guide.

Thank you very much for the reply!
The “2.3” solved the problem.

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