How to use derived TSelector class?

I wrote a class derived from a derived TSelector class. I encountered the following error while using it. I don’t know what is the point to solve such a problem.

  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version  5.18/00b     10 March 2008   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *            *
  *                                         *

ROOT 5.18/00b (branches/v5-18-00-patches@22563, Sep 12 2009, 05:45:00 on linux)

CINT/ROOT C/C++ Interpreter version 5.16.29, Jan 08, 2008
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] 
Attaching file run00437.root as _file0...
root [1] T=(TTree*)gFile->Get("Trigger")             
(class TTree*)0x95b6338
root [2] T->Process("")               
Info in <TUnixSystem::ACLiC>: creating shared library /Users/exaos/Projects/HEG-CSn2ng/Experiment/2010-01/./
dlopen error: /Users/exaos/Projects/HEG-CSn2ng/Experiment/2010-01/./ undefined symbol: _ZN10g1238in8476NotifyEv
Load Error: Failed to load Dynamic link library /Users/exaos/Projects/HEG-CSn2ng/Experiment/2010-01/./
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/Users/exaos/Projects/HEG-CSn2ng/Experiment/2010-01/./fileJaXhOU.o: In function `g1238in847::ShowMembers(TMemberInspector&, char*)':
fileJaXhOU.cxx:(.text+0x11f1): undefined reference to `TinCSn2ng::ShowMembers(TMemberInspector&, char*)'
/Users/exaos/Projects/HEG-CSn2ng/Experiment/2010-01/./fileJaXhOU.o: In function `TinCSn2ng::TinCSn2ng(TTree*)':
fileJaXhOU.cxx:(.text._ZN9TinCSn2ngC2EP5TTree[TinCSn2ng::TinCSn2ng(TTree*)]+0x22): undefined reference to `vtable for TinCSn2ng'
/Users/exaos/Projects/HEG-CSn2ng/Experiment/2010-01/./fileJaXhOU.o: In function `TinCSn2ng::~TinCSn2ng()':
fileJaXhOU.cxx:(.text._ZN9TinCSn2ngD2Ev[TinCSn2ng::~TinCSn2ng()]+0x17): undefined reference to `vtable for TinCSn2ng'
/Users/exaos/Projects/HEG-CSn2ng/Experiment/2010-01/./fileJaXhOU.o:([vtable for g1238in847]+0x98): undefined reference to `g1238in847::Notify()'
/Users/exaos/Projects/HEG-CSn2ng/Experiment/2010-01/./fileJaXhOU.o:([vtable for g1238in847]+0xf4): undefined reference to `g1238in847::Init(TTree*)'
/Users/exaos/Projects/HEG-CSn2ng/Experiment/2010-01/./fileJaXhOU.o:([typeinfo for g1238in847]+0x8): undefined reference to `typeinfo for TinCSn2ng'
collect2: ld returned 1 exit status
*** Interpreter error recovered ***
Error in <TSelector::GetSelector>: file does not have a valid class deriving from TSelector
(Long64_t)(-1) (3.98 KB)


My guess is that you forget to implement g1238in847::Notify.


But it’s parent class has already implemented the Notify(). :frowning:

I will try and see.

If the parent’s class implementation of Notify is all you need, you ought to remove the declaration of Notify in the derived class (g1238in847) [ I.e. you have something like: class g1238in847 : public baseclass { … int Notify(…); }; which in C++ is a declaration of your intention to implement g1238in847::Notify ]