Dictionary creation on .h MakeSelector output

Hi! I’am trying to generate/compile the MakeSelector .h output of a tree (like this one)
I would like to keep thins at minimal intervention (i generate the selectors by looping over all found trees) so i’m trying to aclic only the include files (i have no use for the .C part) but i get a loong error output like this:

root [0] gSystem->SetIncludePath("-I$ROOTSYS/include");
root [1] int rez = gSystem->CompileMacro("O2track.h","O")
Info in <TUnixSystem::ACLiC>: creating shared library /home.hdd/adrian/work/AO2Dproto/o2data_ttree_selector/O2track_h.so
cling::DynamicLibraryManager::loadLibrary(): /home.hdd/adrian/work/AO2Dproto/o2data_ttree_selector/O2track_h.so: undefined symbol: _ZTV7O2track
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/11/../../../../lib64/crt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
/usr/bin/ld: /home.hdd/adrian/work/AO2Dproto/o2data_ttree_selector/O2track_h_ACLiC_dict.o: in function `ROOT::GenerateInitInstanceLocal(O2track const*) [clone .constprop.0]':
O2track_h_ACLiC_dict.cxx:(.text+0xc6): undefined reference to `typeinfo for O2track'
/usr/bin/ld: /home.hdd/adrian/work/AO2Dproto/o2data_ttree_selector/O2track_h_ACLiC_dict.o: in function `ROOT::deleteArray_O2track(void*)':
O2track_h_ACLiC_dict.cxx:(.text+0x43a): undefined reference to `vtable for O2track'

OTOH this seems to work:
rootcling -f O2track_dict.cxx -c -I$(root-config --incdir) O2track.h O2track_linkdef.h
but i had to create by hand the linkdef file.
is there a method the need less human intervention from MakeSelector part to usage of the needed object?
Thank you!

What do you mean by that? The .C part contains the (yes empty but still) implementation of some of the member functions … including the one on which your platform peg the virtual table, i.e. the .C part is necessary as far as I can tell.

well, i could miss/not understand something but i do not use them, here i just want to get the ttree structure, on which to be able to use after instantiation the corresponding reader. The methods defined in the .C file are not used.
You mean that i need them just cause those methods are declared, so i need also the implementation part? (no matter if i make use of those methods or not)
So, it’s just a matter of aclic-ing the C and then just use or not the provided members?

You mean that i need them just cause those methods are declared, so i need also the implementation part? (no matter if i make use of those methods or not)

Yes.

So, it’s just a matter of aclic-ing the C and then just use or not the provided members?

Exactly. They need to be compiled but you do not need to use them.

1 Like

thanks a lot!!

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