I used VS2019 and cmake 3.16.4 to install the Geant4 on my Win10, and supposedly, it is installed correctly, since I have not seen any errors during the process.
I was able to build exampleB1.exe by VS2019, however when I try to run the built *.exe (under Debug folder) as administrator, I get the attached error (fig. run as administrator.jpg).
When I use “exampleB1.exe …\run1.mac” in cmd to run the example, I get the attached error (fig. cmd.jpg).
What am I missing?
Any help is greatly appreciated.
Just to confirm, this is the stock exampleB1 with no modification to the code? The only other things to check are:
If built “as-is” with CMake on Windows, there should be a separate Debug folder under B1-build where the exampleB1.exe is. I know you mentioned this folder, but the command prompt in the screenshot doesn’t appear to show this. Also, unless this folder has been added to the PATH, the exec needs to be run using an absolute/relative path, e.g. .\Debug\exampleB1.exe run1.mac
Which build mode did you use to build/install Geant4? If you built it in Release mode, then the example should be as well.