Libraries missing after installation

Hi every one, I’ve installed Geant4 10.06 for Windows. I followed this guide http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/installguide.html and it looked like that the installation ended without errors.

I tried to compile and run the B1 example, but I get error for missing libraries when I try to run it!
The missing libraries are:

  • G4GMocren.dll
  • G4visHepRep.dll
  • G4Tree.dll
  • G4RayTracer.dll

In attachment:

  • the command for compiling and running the B1 example
  • One example of errors for missing libraries

Does anyone know the way to solve please?

log.txt (2.1 KB)

You also need to follow the steps at http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/InstallationGuide/html/postinstall.html

Likely that it can’t find the dlls because the associated environment variables aren’t set that would tell it where to find them (particularly your PATH variable)

Hi @dnevill, thank you for your reply. I followed the postinstall guide,I compiled again the B1 source, but now I get another error. It can’t find the VCRUNTIME140_1.dll file.

Looks like you’ve somehow built, on Windows, against Visual C++ , but don’t have the associated run-times properly installed. In a properly working install there are too many registry entries related to this file and its associated files to list here, you’ve somehow ended up with the dlls (or the headers for them) placed such that you were able to build the .exe, but they’re not where the executable is looking for them. The right solution would probably be to reinstall Visual Studio or Visual Code (whichever one and version you’re building with here), build against that (i.e. don’t build a VS2017 project if using VS2019) and then run it.

A possible short-term fix would be to look for the dlls its looking for and either copy them to the local directory or add them to your Path variable (on my system that one is at C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.UWPDesktop_14.0.27629.0_x64__8wekyb3d8bbwe and at C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.UWPDesktop_14.0.27810.0_x64__8wekyb3d8bbwe but there are probably other missing Visual C++ related dlls it can’t find but hasn’t yet complained about yet while that error takes priority), but if you do that, it is not the normal proper way for a Visual Studio or Visual Code based setup to work and may cause yourself more problems down the way if you do this, it works, but try to build anything else later or try to change Visual Studio/Visual Code versions.

My advice is to use the associated official installer for Visual Studio or Visual Code for whichever version you’re trying to use (which version is officially supported for Geant4 depends on which version of Geant4 you are using, for instance 10.6 is VS 2019, 10.5 is VS 2017, I don’t think Visual Code is/was ever officially supported). If you’re not trying to use Visual Studio or Visual Code, I’d recommend using the cmake GUI instead of the command line utility, it will guide you through making sure you’re building for whatever you plan to use to compile, the command line utility will make assumptions about anything you don’t explicitly tell it (on Windows, it believe it assumes some version of Visual C++, I’m not sure if any other compilers are even officially supported on Windows as that’s all I’ve ever tried to use on that platform)

Hi @dnevill thank you! I installed VS2019 again, I compiled and runned B1 example and it looks like to work.

Now I’ve to modify the B1 example (I started to do it in november but given that I had to do another work, I didn’t continue do to it). I don’t know if you remember, but I had problems to delete the shapes (you were helping me). Please, can you check it How to modify B1 example ?