The example macros (specifically init_vis.mac
) do usually assume an OpenGL visualisation driver is available, so you might be seeing a similar problem to Error 500 when compiling examples.
You can either reconfigure/rebuild Geant4 with the CMake variable GEANT4_USE_OPENGL_WIN32
set to ON
, or change the line in the macro that selects the OGL driver to one of those available.