Cmake error during example B1

I installed conda geant4 (11.1.3) in windows using WSL platform. I am trying to compile example B1 of geant4 (version 11.1.3) via cmake. But the following error pops up:
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find EXPAT (missing: EXPAT_LIBRARY EXPAT_INCLUDE_DIR) (Required is at least version “2.5.0”)
Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22/Modules/FindEXPAT.cmake:65 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package) /home/smaran/anaconda3/envs/geant4/lib/cmake/Geant4/Geant4Config.cmake:268 (find_dependency) CMakeLists.txt:13 (find_package)
– Configuring incomplete, errors occurred! See also “/home/smaran/Geant4 project/B1/build/CMakeFiles/CMakeOutput.log”.
_Geant4 Version: 11.1.3
_Operating System: WSL
Compiler/Version:
_CMake Version: 3.22.1


Did you solve this, as your post Error while running exampleB1 [WSL] suggests you now have a running B1?

Yes, I solved it. At first, I uninstalled the whole Geant4 software along with the Conda environment. Again, I installed it, but this time I used below command line:

conda install -c conda-forge geant4 cmake make compilers

Then, I got cmake error-free. This time, while executing exampleB1, this error pops up:

./exampleB1: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory(geant4) smaran@Smaran:~/Geant4 project/B1/build

Also, I solved it by using this command line:

sudo apt-get install libgl1

Again, I faced problem executing exampleB1.The error message is:

Available UI session types: [ Qt, tcsh, csh ] qt.qpa.xcb: could not connect to display qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb. Aborted (core dumped)

I attached the screenshot. Please, help me and I really appreciate your help.

_Geant4 Version: 11.1.3
_Operating System: WSL
Compiler/Version:
_CMake Version: 3.28.3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.