Hi, I have a class daqT (in daqT.h and daqT.C) created from TTree::MakeClass. Following the suggestions in root.cern.ch/download/doc/ROOTUs … 12s21.html I have left the autogenerated files alone and I instead created a derived class MydaqT (in MydaqT.h and MydaqT.C). The derived class inherits from daqT and #includes the daqT.h header.
In the ROOT interpreter if I try to do .L MydaqT.C++, I get a spray of errors:
Info in <TUnixSystem::ACLiC>: creating shared library /Users/jfcaron/Projects/Proto2BeamTest2/./MydaqT_C.so
Undefined symbols for architecture x86_64:
"daqT::Cut(long long)", referenced from:
vtable for MydaqT in MydaqT_C_ACLiC_dict.o
"daqT::Init(TTree*)", referenced from:
vtable for MydaqT in MydaqT_C_ACLiC_dict.o
"daqT::Show(long long)", referenced from:
vtable for MydaqT in MydaqT_C_ACLiC_dict.o
"daqT::Notify()", referenced from:
vtable for MydaqT in MydaqT_C_ACLiC_dict.o
"daqT::GetEntry(long long)", referenced from:
vtable for MydaqT in MydaqT_C_ACLiC_dict.o
"daqT::LoadTree(long long)", referenced from:
vtable for MydaqT in MydaqT_C_ACLiC_dict.o
"daqT::daqT(TTree*)", referenced from:
__ZL31G__MydaqT_C_ACLiC_dict_3417_0_5P8G__valuePKcP8G__parami in MydaqT_C_ACLiC_dict.o
__ZN4ROOTL10new_MydaqTEPv in MydaqT_C_ACLiC_dict.o
__ZN4ROOTL15newArray_MydaqTElPv in MydaqT_C_ACLiC_dict.o
"daqT::~daqT()", referenced from:
__ZL31G__MydaqT_C_ACLiC_dict_3417_0_5P8G__valuePKcP8G__parami in MydaqT_C_ACLiC_dict.o
__ZL31G__MydaqT_C_ACLiC_dict_3417_0_7P8G__valuePKcP8G__parami in MydaqT_C_ACLiC_dict.o
__ZN4ROOTL15newArray_MydaqTElPv in MydaqT_C_ACLiC_dict.o
__ZN4ROOTL18deleteArray_MydaqTEPv in MydaqT_C_ACLiC_dict.o
MydaqT::~MydaqT() in MydaqT_C_ACLiC_dict.o
MydaqT::~MydaqT() in MydaqT_C_ACLiC_dict.o
"typeinfo for daqT", referenced from:
typeinfo for MydaqT in MydaqT_C_ACLiC_dict.o
"vtable for daqT", referenced from:
__ZL31G__MydaqT_C_ACLiC_dict_3417_0_6P8G__valuePKcP8G__parami in MydaqT_C_ACLiC_dict.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in <ACLiC>: Compilation failed!
I get no error if I first do .L daqT.C++ before doing .L MydaqT.C++. Why is this necessary? I mean I use TVectors in the code and I don’t need to do .L TVectorD.h++, shouldn’t #include “daqT.h” be enough?
Jean-François