Using a class derived from TObject with make

Hi,

I am trying to use a class derived from TObject with make instead of the normal way of root macro_name.C+. When I run make, I get errors like this:

[quote]/afs/cern.ch/cms/slc5_amd64_gcc462/external/gcc/4.6.2/bin/…/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/…/…/…/…/x86_64-unknown-linux-gnu/bin/ld: lib/libEfficiency.a(MuonTagAndProbeMod.o): in function mithep::MuonTagAndProbeMod::IsA() const:interface/MuonTagAndProbeMod.h:111: error: undefined reference to ‘mithep::MuonTagAndProbeMod::Class()’
/afs/cern.ch/cms/slc5_amd64_gcc462/external/gcc/4.6.2/bin/…/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/…/…/…/…/x86_64-unknown-linux-gnu/bin/ld: lib/libEfficiency.a(MuonTagAndProbeMod.o): in function vtable for mithep::MuonTagAndProbeMod:MuonTagAndProbeMod.cc(.rodata._ZTVN6mithep18MuonTagAndProbeModE+0x1d0): error: undefined reference to ‘mithep::MuonTagAndProbeMod::ShowMembers(TMemberInspector&)’
/afs/cern.ch/cms/slc5_amd64_gcc462/external/gcc/4.6.2/bin/…/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/…/…/…/…/x86_64-unknown-linux-gnu/bin/ld: lib/libEfficiency.a(MuonTagAndProbeMod.o): in function vtable for mithep::MuonTagAndProbeMod:MuonTagAndProbeMod.cc(.rodata._ZTVN6mithep18MuonTagAndProbeModE+0x1d8): error: undefined reference to 'mithep::MuonTagAndProbeMod::Streamer(TBuffer&)'
collect2: ld returned 1 exit status[/quote]

Does anyone know how to fix this?

Line 111 is the line where I do ClassDef(…).

I suspect I need to link to some root libraries that I am not linking to.

Thanks.

Andrew

Hi,

You need to generate (via rootcint), compile and link a dictionary for your classes.
See the faq: root.cern.ch/drupal/content/how- … dictionary

Cheers,
Philippe.