Hello-
I’m trying to create a shared library with some code I’ve written, and I’m getting issues when I try to compile with ROOT. I’m hoping someone can tell me where I’m going wrong, as it’s linking errors and I’m unsure how to fix those.
The files can be found here: debugging_linking – Google Drive
This is what I get when I try to compile:
<tboone> root
root [0] .L ana_cal.C+
Info in <TUnixSystem::ACLiC>: creating shared library /path/to/file/./ana_cal_C.so
cling::DynamicLibraryManager::loadLibrary(): /path/to/file/ana_cal_C.so: undefined symbol: _ZN15calAnalyzerTree10m_instanceE
/lib/../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `calAnalyzerTree::~calAnalyzerTree()':
ana_cal_C_ACLiC_dict.cxx:(.text+0x95): undefined reference to `TTree::GetCurrentFile() const'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `ROOT::deleteArray_calAnalyzerTree(void*)':
ana_cal_C_ACLiC_dict.cxx:(.text+0x2649): undefined reference to `TTree::GetCurrentFile() const'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `calAnalyzerTree::~calAnalyzerTree()':
ana_cal_C_ACLiC_dict.cxx:(.text+0x27e5): undefined reference to `TTree::GetCurrentFile() const'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `ROOT::destruct_calAnalyzerTree(void*)':
ana_cal_C_ACLiC_dict.cxx:(.text+0x2923): undefined reference to `TTree::GetCurrentFile() const'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `ROOT::delete_calAnalyzerTree(void*)':
ana_cal_C_ACLiC_dict.cxx:(.text+0x2b09): undefined reference to `TTree::GetCurrentFile() const'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `ROOT::newArray_calAnalyzerTree(long, void*)':
ana_cal_C_ACLiC_dict.cxx:(.text+0x3bb5): undefined reference to `TTree::Class()'
ana_cal_C_ACLiC_dict.cxx:(.text+0x3cb5): undefined reference to `TTree::Class()'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `calAnalyzerTree::calAnalyzerTree(TTree*)':
ana_cal_C_ACLiC_dict.cxx:(.text+0x3dc6): undefined reference to `TTree::Class()'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `ROOT::new_calAnalyzerTree(void*)':
ana_cal_C_ACLiC_dict.cxx:(.text+0x3e4d): undefined reference to `TTree::Class()'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `ana_cal::nullify()':
ana_cal_C_ACLiC_dict.cxx:(.text+0x4b34): undefined reference to `calAnalyzerTree::m_instance'
ana_cal_C_ACLiC_dict.cxx:(.text+0x4b67): undefined reference to `TTree::GetCurrentFile() const'
ana_cal_C_ACLiC_dict.cxx:(.text+0x4b89): undefined reference to `calAnalyzerTree::m_instance'
/path/to/file/ana_cal_C_ACLiC_dict.o: In function `ana_cal::init()':
ana_cal_C_ACLiC_dict.cxx:(.text+0x4ce0): undefined reference to `calAnalyzerTree::m_instance'
ana_cal_C_ACLiC_dict.cxx:(.text+0x4d17): undefined reference to `TTree::GetCurrentFile() const'
ana_cal_C_ACLiC_dict.cxx:(.text+0x4d39): undefined reference to `calAnalyzerTree::m_instance'
ana_cal_C_ACLiC_dict.cxx:(.text+0x4e59): undefined reference to `calAnalyzerTree::m_instance'
ana_cal_C_ACLiC_dict.cxx:(.text+0x4f17): undefined reference to `calAnalyzerTree::m_instance'
ana_cal_C_ACLiC_dict.cxx:(.text+0x508f): undefined reference to `calAnalyzerTree::m_instance'
collect2: error: ld returned 1 exit status
root [1] .q