Geant4 Windows Binary static library issue

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

Geant4 Version: 11.3.2
Operating System:Windows 11
Compiler/Version:MSVS C++17
CMake Version:4.1.2


Hello I am having an issue with Geant4’s Windows binary specifically to do with static library.

I am in an environment where I cannot install GEANT4 from source. Hence, I am trying to use Windows Binary version of GEANT4.

Due to computing environment reason, I would like to use static library.

So far, I have made following changes:

1. changed flag to “yes” inside geant4-config static lib flag.

  1. I changed a flag (set(Geant4_shared_FOUND OFF)
    set(Geant4_static_FOUND ON) )inside of Geant4config.cmake file located inside of lib/cmake folder.

After this, when I tried to compile B1 example for test, I get following error.

CMake Error at CMakeLists.txt:26 (target_link_libraries):
Target “exampleB1” links to:

Geant4::G4Tree-static

but the target was not found. Possible reasons include:

* There is a typo in the target name.
* A find_package call is missing for an IMPORTED target.
* An ALIAS target is missing.

Could anyone who has experienced of running GEANT4 on Windows help me please?

Thank you.

Kind regards