I have problem with execute example B1 in Geant4

i am using geant4.10.07.p02 and my operating system is windows and i use Ubuntu 20.04.6 LTS
I found difficult to execute example B1 and the following error :./exampleB1: error while loading shared libraries: libG4graphics_reps.so: cannot open shared object file: No such file or directory.
could you please help me solve this problem ?

Hi @Marina297

Since libraries are not shared therefore you need to define path of geant4.sh i.e. source /path_to_geant4_Install/bin/geant4.sh in .bashrc, alternately you can try,

step 1
From the source example1 archive,

mkdir build; cd build


source /path_to_geant4_Install/bin/geant4.sh


cmake ../





thanks for your reply, but i could not find example1 in source dir as following

In the screenshot it looks the source code directory. You do not need to do anything here.

[If you installed in Linux]
To set environment you need to define geant4-installtion path in bashrc.
You can check the .bashrc file using – $ gedit .bashrc
Assuming you installed geant4 in the directory named ‘geant4-Install’ then it should be
define this path in .bashrc as;

source /home/xyz/geant4-install-seq/bin/geant4.sh

Once defined then you can exit .bashrc and follow
. .bashrc or source .bashrc

copy examples B1 directory anywhere in a new directory.
and follow steps as defined previously. You can skip step2 if you use path in .bashrc.

If problem occurs you can share the geant4-install directory_path.
open in terminal from geant4-install directory and type pwd. This will be geant4-install path.

References: 1. Required Environment Settings on UNIX [Postinstall Setup — Geant4 Installation Guide 11.1 documentation]
2. Required Environment Settings on Windows [ Postinstall Setup — Geant4 Installation Guide 11.1 documentation]

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