Uninstalling Geant4


I installed geant4 ,but when i run example B1 i get errors of missing .dll files. I have followed the post installation steps too. So i am trying to uninstall. How do i uninstall in windows? I cant find it in add/remove programs.


Hi, I copy here the answer I gave you in the other post:

To “uninstall” Geant4, you just have to delete all the files in your install directory.
In addition, if you also want to recompile all the code, you must also delete all the files in the build directory.

1 Like

Hi Andrea,

Thank you. Yes I did that, I also then build it again. Can you please tell me the steps before which you took? Like the additional files installed except visual studio and cmake?

It depends on what you need…

For the visualization I use Qt (now i’m on version 5.12.6) and to use it you have to install the “msvc 2017 32-bit” or “msvc 217 64-bit” for 32 bit and 64 bit installation respectively and add two options to cmake.

Here is the options that I use:

-DCMAKE_PREFIX_PATH=C:\Qt\5.12.6\msvc2017_64\bin (The path to the bin directory of Qt)

Did you get any error during the building and installation?
If not, did you set all the necessary environmental variables?

I did all that and now a new error pops up while running example b1. The code execution cannot proceed because Qt5OpenGL.dll was not found. Now where am i going wrong

Did you add the Qt bin directory to your PATH?

Yes I did… the whole path. Now I am “reinstalling” with just opengl on and see if it works

And now I just get this and it hangs?

The visualization with OpenGL is not interactive.
Are you able to run a simulation?

so when I run the exe file I get the above image, thats it. and this in the cmd box

When using with Qt I get the error as its not able to find the Qt5.dll file
This was the path i had previously specified while using Qt5.9.9

This is the command-line interface of Geant4. In “Idle state” you can type commands to run the simulation and to do a lot of other things. For example, if you type “/run/beamOn 1” you can start a run with 1 event…

For Qt: the path you wrote is the path that you used with the option DCMAKE_PREFIX_PATH, right?
But, did you add also this path to the environmental variable Path of Windows?

For the command line yes, i tried the run commands, it does show some changes in the figure. I was expecting a complete figure. it looks “weird” to me
For the Qt yes I did add the path but i did not add in the environment variable. I was following the guide but it doesnt mention it anywhere. How should I add it to environment variable and what should I name it?

I am sorry for my naivety. I am new to this and a “User” and I want to simulate xray beams impinging on a solid and see the absorbtion dose. Hence I though of using this simulation

This is not in the guide because this concern the installation of Qt.
I don’t know if you are on Win7 or Win10, but you have to go to the Environmental Variables menù (the same that you used to set the G4 data variable).
Here you can find a “system environmental variable” called “Path” (NOT “user environmental variable”)
In this variable are memorised some path. you have to add the Qt bin path to the others.

That’s it.

Thanks Andrea, I will try it out and see what I get. I have Windows 10 and no enough hardrive space so I downloaded the QT 5.9.9 from the website.
Do we also need COIN3D or Xerces for the examples?

No, you only need an installation of Qt.

On Win 10, modifying the Path variable is simpler!