Hi,
I need to understand what is “undefined reference to” means?? what is missing??
please check the below error when i try to run the code. Just need to know is the error from ROOT or my code?
thanks,
Mai
melsawy@lxplus0051 bin]$ g++ monoNtupleAnalyzer.cc -o monoNtupleAnalyzer root-config --cflags
/tmp/melsawy/ccL5doBj.o: In function main': monoNtupleAnalyzer.cc:(.text+0x2ec): undefined reference to
TFile::TFile(char const*, char const*, char const*, int)'
monoNtupleAnalyzer.cc:(.text+0x300): undefined reference to TDirectoryFile::Get(char const*)' monoNtupleAnalyzer.cc:(.text+0x5ad): undefined reference to
TFile::TFile(char const*, char const*, char const*, int)‘
monoNtupleAnalyzer.cc:(.text+0x5bd): undefined reference to TObject::operator delete(void*)' monoNtupleAnalyzer.cc:(.text+0xf4b): undefined reference to
TFile::~TFile()‘
monoNtupleAnalyzer.cc:(.text+0xf62): undefined reference to TFile::~TFile()' /tmp/melsawy/ccL5doBj.o: In function
__static_initialization_and_destruction_0(int, int)’:
monoNtupleAnalyzer.cc:(.text+0x1050): undefined reference to TVersionCheck::TVersionCheck(int)' /tmp/melsawy/ccL5doBj.o: In function
TObject::operator new(unsigned long)’:
/tmp/melsawy/ccL5doBj.o: In function int TTree::SetBranchAddress<std::vector<bool, std::allocator<bool> > >(char const*, std::vector<bool, std::allocator<bool> >**, TBranch**)': monoNtupleAnalyzer.cc:(.text._ZN5TTree16SetBranchAddressISt6vectorIbSaIbEEEEiPKcPPT_PP7TBranch[int TTree::SetBranchAddress<std::vector<bool, std::allocator<bool> > >(char const*, std::vector<bool, std::allocator<bool> >**, TBranch**)]+0x2c): undefined reference to
TClass::GetClass(std::type_info const&, bool, bool)‘
monoNtupleAnalyzer.cc:(.text._ZN5TTree16SetBranchAddressISt6vectorIbSaIbEEEEiPKcPPT_PP7TBranch[int TTree::SetBranchAddress<std::vector<bool, std::allocator > >(char const*, std::vector<bool, std::allocator >, TBranch)]+0x4b): undefined reference to TDataType::GetType(std::type_info const&)' /tmp/melsawy/ccL5doBj.o: In function
int TTree::SetBranchAddress<std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > > >(char const*, std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >, TBranch)’:
monoNtupleAnalyzer.cc:(.text._ZN5TTree16SetBranchAddressISt6vectorISsSaISsEEEEiPKcPPT_PP7TBranch[int TTree::SetBranchAddress<std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > > >(char const*, std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > >, TBranch)]+0x2c): undefined reference to TClass::GetClass(std::type_info const&, bool, bool)' monoNtupleAnalyzer.cc:(.text._ZN5TTree16SetBranchAddressISt6vectorISsSaISsEEEEiPKcPPT_PP7TBranch[int TTree::SetBranchAddress<std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >(char const*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >**, TBranch**)]+0x4b): undefined reference to
TDataType::GetType(std::type_info const&)’
/tmp/melsawy/ccL5doBj.o: In function int TTree::SetBranchAddress<unsigned int>(char const*, unsigned int*, TBranch**)': monoNtupleAnalyzer.cc:(.text._ZN5TTree16SetBranchAddressIjEEiPKcPT_PP7TBranch[int TTree::SetBranchAddress<unsigned int>(char const*, unsigned int*, TBranch**)]+0x2c): undefined reference to
TClass::GetClass(std::type_info const&, bool, bool)‘
monoNtupleAnalyzer.cc:(.text._ZN5TTree16SetBranchAddressIjEEiPKcPT_PP7TBranch[int TTree::SetBranchAddress(char const*, unsigned int*, TBranch**)]+0x4b): undefined reference to TDataType::GetType(std::type_info const&)' /tmp/melsawy/ccL5doBj.o: In function
int TTree::SetBranchAddress<std::vector<double, std::allocator > >(char const*, std::vector<double, std::allocator >, TBranch)’:
monoNtupleAnalyzer.cc:(.text._ZN5TTree16SetBranchAddressISt6vectorIdSaIdEEEEiPKcPPT_PP7TBranch[int TTree::SetBranchAddress<std::vector<double, std::allocator > >(char const*, std::vector<double, std::allocator >, TBranch)]+0x2c): undefined reference to TClass::GetClass(std::type_info const&, bool, bool)' monoNtupleAnalyzer.cc:(.text._ZN5TTree16SetBranchAddressISt6vectorIdSaIdEEEEiPKcPPT_PP7TBranch[int TTree::SetBranchAddress<std::vector<double, std::allocator<double> > >(char const*, std::vector<double, std::allocator<double> >**, TBranch**)]+0x4b): undefined reference to
TDataType::GetType(std::type_info const&)’
/tmp/melsawy/ccL5doBj.o:(.rodata._ZTV10TCanvasImp[vtable for TCanvasImp]+0xf8): undefined reference to TCanvasImp::ShowMembers(TMemberInspector&)' /tmp/melsawy/ccL5doBj.o:(.rodata._ZTV10TCanvasImp[vtable for TCanvasImp]+0x100): undefined reference to
TCanvasImp::Streamer(TBuffer&)’
/tmp/melsawy/ccL5doBj.o:(.rodata._ZTV15TApplicationImp[vtable for TApplicationImp]+0x78): undefined reference to TApplicationImp::ShowMembers(TMemberInspector&)' /tmp/melsawy/ccL5doBj.o:(.rodata._ZTV15TApplicationImp[vtable for TApplicationImp]+0x80): undefined reference to
TApplicationImp::Streamer(TBuffer&)'
collect2: ld returned 1 exit status