Hi guys,
when I compile the geant4 program with root using cmake, it compiles successfully but fails when linking with the following error message:
CMakeFiles/EJdetector.dir/src/EJAnalysisManager.cc.o: In function `EJAnalysisManager::book()':
EJAnalysisManager.cc:(.text+0x8d2): undefined reference to `TStorage::ObjectAlloc(unsigned long)'
EJAnalysisManager.cc:(.text+0x8f4): undefined reference to `TFile::TFile(char const*, char const*, char const*, int)'
EJAnalysisManager.cc:(.text+0x900): undefined reference to `TDirectory::CurrentDirectory()'
EJAnalysisManager.cc:(.text+0x90d): undefined reference to `TStorage::ObjectAlloc(unsigned long)'
EJAnalysisManager.cc:(.text+0x92e): undefined reference to `TTree::TTree(char const*, char const*, int, TDirectory*)'
EJAnalysisManager.cc:(.text+0x955): undefined reference to `TTree::Branch(char const*, void*, char const*, int)'
EJAnalysisManager.cc:(.text+0xab9): undefined reference to `TObject::operator delete(void*)'
EJAnalysisManager.cc:(.text+0xacc): undefined reference to `TObject::operator delete(void*)'
CMakeFiles/EJdetector.dir/src/EJAnalysisManager.cc.o: In function `_GLOBAL__sub_I_EJAnalysisManager.cc':
EJAnalysisManager.cc:(.text.startup+0x3b): undefined reference to `TVersionCheck::TVersionCheck(int)'
CMakeFiles/EJdetector.dir/src/EJEventAction.cc.o: In function `_GLOBAL__sub_I_EJEventAction.cc':
EJEventAction.cc:(.text.startup+0x38): undefined reference to `TVersionCheck::TVersionCheck(int)'
CMakeFiles/EJdetector.dir/src/EJRunAction.cc.o: In function `_GLOBAL__sub_I_EJRunAction.cc':
EJRunAction.cc:(.text.startup+0x38): undefined reference to `TVersionCheck::TVersionCheck(int)'
Also, root is used directly via binary and I have tried to execute the command
**source thisroot.sh**
.
Please help me, I’d appreciate it !
Please read tips for efficient and successful posting and posting code
_ROOT Version:6.26/02 (binary version)
_Platform:Ubuntu 18
_Compiler:gcc-11 g+±11