# Error in running Example B1

**URL:** <https://geant4-forum.web.cern.ch/t/error-in-running-example-b1/830>\
**Category:** Getting Started\
**Created:** [August 30, 2019, 3:32pm UTC](https://geant4-forum.web.cern.ch/t/error-in-running-example-b1/830 "2019-08-30T15:32:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geant4Fan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/geant4fan/32/351_2.png) [@Geant4Fan](https://geant4-forum.web.cern.ch/u/Geant4Fan)\
**Post date:** [August 30, 2019, 3:32pm UTC](https://geant4-forum.web.cern.ch/t/error-in-running-example-b1/830/1 "2019-08-30T15:32:10Z")

</div>

Hi Everyone!

I am running into this problem when executing the Example B1 that was successfully configured and generated, see attached screenshot. When I try to open the project by command ./exampleB1 it gives error message “error while loading shared libraries: libG4graphics\_reps.so, cannot open shared object file …”, see attached screenshot. I tried different ways to go around, but with no success. If anyone can help me in this that would be greatly appreciated. Thank you in advance!

With best regards,  
Michael

 ![screenshot](https://geant4-forum.web.cern.ch/uploads/default/original/1X/e7ff6a239918d9559eb9e8d39608f1e506285988.png)

---

<div class="post-metadata">

**Author:** ![php1ic](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/php1ic/32/355_2.png) [@php1ic](https://geant4-forum.web.cern.ch/u/php1ic)\
**Post date:** [September 2, 2019, 12:45pm UTC](https://geant4-forum.web.cern.ch/t/error-in-running-example-b1/830/2 "2019-09-02T12:45:32Z")

</div>

Have you added the script to your `~/.bashrc` so environments are set every time you run a terminal?

[https://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/postinstall.html#required-environment-settings-on-unix](https://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/postinstall.html#required-environment-settings-on-unix)

Otherwise, what is the output of `ldd`? i.e. run:  
`ldd exampleB1`

Look for the libG4graphics\_reps.so line, does it point to a valid path? I’ve not upgraded to 10.5 yet but I get the following for my install:

$ ldd exampleB1 | grep libG4graphics  
libG4graphics\_reps.so =\> /usr/local/share/geant4/10.4.0/install/debug/lib/libG4graphics\_reps.so (0x00007f280a110000)

---

<div class="post-metadata">

**Author:** ![Geant4Fan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/geant4fan/32/351_2.png) [@Geant4Fan](https://geant4-forum.web.cern.ch/u/Geant4Fan)\
**Post date:** [September 4, 2019, 6:30pm UTC](https://geant4-forum.web.cern.ch/t/error-in-running-example-b1/830/3 "2019-09-04T18:30:32Z")

</div>

Thank you very much for your reply! I appreciate that. I am out of town now, I will try your instructions when I am back next week, and will let you know. Thanks again!

---

<div class="post-metadata">

**Author:** ![Geant4Fan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/geant4fan/32/351_2.png) [@Geant4Fan](https://geant4-forum.web.cern.ch/u/Geant4Fan)\
**Post date:** [September 12, 2019, 8:18pm UTC](https://geant4-forum.web.cern.ch/t/error-in-running-example-b1/830/4 "2019-09-12T20:18:01Z")

</div>

Hi my friend,

Finally, I came back and tried all your instructions. It helped, now I do not get that error message. However, after launching ./exampleB1 it starts doing something and it takes forever to finish calculations, it becomes idle with blinking cursor, I attached txt file with copy-pasted text from the console. I google searched for possible solutions, but with no success. Anything you can recommend?  
[text \_ exampleB1.txt](https://geant4-forum.web.cern.ch/uploads/short-url/cf4QkvygOrxKOTmH7t3iPnh5NQ0.txt) (8.1 KB)

---

<div class="post-metadata">

**Author:** ![php1ic](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/php1ic/32/355_2.png) [@php1ic](https://geant4-forum.web.cern.ch/u/php1ic)\
**Post date:** [September 13, 2019, 4:14pm UTC](https://geant4-forum.web.cern.ch/t/error-in-running-example-b1/830/5 "2019-09-13T16:14:00Z")

</div>

Looks like you didn’t build/install with any UI components.

From the file you uploaded:

```auto
yahya@yahya-VirtualBox:~/Geant4/Examples/B1-build$ ./exampleB1
Available UI session types: [GAG, tcsh, csh]
.
.
.
Visualization Manager initialising...
Registering graphics systems...

You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)

```

Followed by multiple instances of:

```auto
ERROR: Current scene handler not defined. Please select or create one.

```

I configured to use Qt and see:

```auto
Available UI session types: [Qt, GAG, tcsh, csh]
.
.
.
You have successfully registered the following graphics systems.
Current available graphics systems are:
ASCIITree (ATree)
DAWNFILE (DAWNFILE)
G4HepRep (HepRepXML)
G4HepRepFile (HepRepFile)
RayTracer (RayTracer)
VRML1FILE (VRML1FILE)
VRML2FILE (VRML2FILE)
gMocrenFile (gMocrenFile)
OpenGLImmediateQt (OGLIQt, OGLI)
OpenGLStoredQt (OGLSQt, OGL, OGLS)
OpenGLImmediateX (OGLIX, OGLIQt_FALLBACK)
OpenGLStoredX (OGLSX, OGLSQt_FALLBACK)
RayTracerX (RayTracerX)

```

---

<div class="post-metadata">

**Author:** ![Geant4Fan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/geant4fan/32/351_2.png) [@Geant4Fan](https://geant4-forum.web.cern.ch/u/Geant4Fan)\
**Post date:** [September 13, 2019, 9:21pm UTC](https://geant4-forum.web.cern.ch/t/error-in-running-example-b1/830/6 "2019-09-13T21:21:20Z")

</div>

This solved my problem, thank you so much!

This is what happened. I did install OPENGL and QT GUIs before, but for some reasons, they did not work. I decided to uninstall and re-install, then they worked fine. Your answer led me to a conclusion that the problem must be nothing but a problem with the installation. Thanks again, I appreciate your help!
