"Undefined reference to `TVersionCheck::TVersionCheck(int)' " error, when including Root header to GEANT4 program

Dear Root & Geant4 experts

I am getting this error when trying to include root header to the Geant4 application. The Geant4 application works well otherwise. I did make sure that cmake is able to find the ROOTSYS. Also, when the root header is not included before Geant4 headers I get warnings of a conflict between the declaration of s in TString.h and CLHEP::SystemOfUnits.h . I have also tried checking with other versions of Root and Geant4.

_ROOT Version: 6.20.00 / 6.14.06
_Platform: Ubuntu 16.04
_Compiler: Cmake 3.16.4 , Geant4.10.05 / Geant4.10.06.p01


The error in the title indicates that you are not linking against the ROOT libraries (libCore in particular)

This fixed it. Thank you again.

Can you please tell me how the indicated error meant libCore was not linked? I mean is there any reference from where I can understand which libraries are not linked from the error message?

In principle through the documentation of TVersionCheck which should tell you which library to link. That’s broken, I’m working on the fix!

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