Ld cannot find -lEve -lGeom and -lGdml

Dear ROOT experts:

I am trying to build a geant4 project which uses root libraries.
In the CMakeList, I link the root libraries with this command:

target_link_libraries(MuImag ${ROOT_LIBRARIES} -lEve -lGeom -lGdml)

Then error occurs during the linking process:

/usr/bin/ld: cannot find -lEve
/usr/bin/ld: cannot find -lGeom
/usr/bin/ld: cannot find -lGdml

I have appended $ROOTSYS/lib to LD_LIBRARY_PATH, and checked that libEve.so and libEve.rootmap etc. are in the directory.

Could you give me some hints on what’s happening ?

Best,
Zhi Yu

Please provide the following information:


ROOT Version (e.g. 6.10/08):
Platform, compiler (e.g. Ubuntu 18.04, gcc7.3):


I have solved this problem by adding this command in CMakeList:

include(${ROOT_USE_FILE})

But why linker cannot find -lEve etc. through LD_LIBRARY_PATH ?

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