# Error 500 when compiling examples

**URL:** <https://geant4-forum.web.cern.ch/t/error-500-when-compiling-examples/10116>\
**Category:** Getting Started\
**Created:** [March 1, 2023, 11:38am UTC](https://geant4-forum.web.cern.ch/t/error-500-when-compiling-examples/10116 "2023-03-01T11:38:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommasorizzi](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/tommasorizzi/32/6162_2.png) [@tommasorizzi](https://geant4-forum.web.cern.ch/u/tommasorizzi)\
**Post date:** [March 1, 2023, 11:38am UTC](https://geant4-forum.web.cern.ch/t/error-500-when-compiling-examples/10116/1 "2023-03-01T11:38:48Z")

</div>

Hi, I’m new with GEANT4 and I’m using it on Windows 10 system. I went through the installation which should be well done and also I did the post-installation procedure to set the environmental variables. The project are compiled with latest version of Visual Studio, however when the file .exe is created i got this kind of error for all the examples available.

 ![error](https://geant4-forum.web.cern.ch/uploads/default/original/2X/8/8cd9a3f5d00b29f459a43287fbeb60ad9159b242.png)

If you need other info please ask, and thanks for helping.

---

<div class="post-metadata">

**Author:** ![bmorgan](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/bmorgan/32/7_2.png) [@bmorgan](https://geant4-forum.web.cern.ch/u/bmorgan)\
**Post date:** [March 2, 2023, 12:18pm UTC](https://geant4-forum.web.cern.ch/t/error-500-when-compiling-examples/10116/2 "2023-03-02T12:18:23Z")

</div>

I don’t _think_ this is an error as such, rather, the `init.mac`/`init_vis.mac` file(s) that are run as part of the start up default to using OpenGL visualization. That’s the line

```auto
/vis/sceneHandler/create OGL

```

but the output on available drivers under the “Registered graphics systems are:” does not show OpenGL as being available. To fix this you can either:

- Reinstall Geant4 with OpenGL support using the CMake `GEANT4_USE_OPENGL_WIN32` configuration option (see the build options in the [Install Guide](https://geant4-userdoc.web.cern.ch/UsersGuides/InstallationGuide/html/installguide.html#geant4-build-options).
- Change the `OGL` argument to one of those listed under the `Registered Graphics Systems` list. However, that will not be interactive.

---

<div class="post-metadata">

**Author:** ![tommasorizzi](https://geant4-forum.web.cern.ch/user_avatar/geant4-forum.web.cern.ch/tommasorizzi/32/6162_2.png) [@tommasorizzi](https://geant4-forum.web.cern.ch/u/tommasorizzi)\
**Post date:** [March 3, 2023, 5:15pm UTC](https://geant4-forum.web.cern.ch/t/error-500-when-compiling-examples/10116/3 "2023-03-03T17:15:50Z")

</div>

Thank you, I followed your instruction re-installing Geant4 with the OpenGL visualization on and now it works!

---

<div class="post-metadata">

**Author:** ![system](https://geant4-forum.web.cern.ch/uploads/default/original/1X/ce519a43ebdf7ac48a98a03c6ad6eea013b68c46.png) [@system](https://geant4-forum.web.cern.ch/u/system)\
**Post date:** [April 2, 2023, 5:16pm UTC](https://geant4-forum.web.cern.ch/t/error-500-when-compiling-examples/10116/4 "2023-04-02T17:16:21Z")

</div>

Closed on April 2, 2023, 5:16pm UTC

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