Re: problem at compilation with a derivative of TSelector

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Tue, 13 Jul 2010 16:31:45 +0200


Marc,

You need to generate a dictionary for your selector class. If you do not know how to do it, I strongly recommend to use ACLIC in teh following way that will automatically generate the dictionary for you and also the processing will be faster.

Replace your main.C by mymain.C as
int mymain()
{
  TChain *mychain_data=new TChain("PAUReco");   mychain_data->Add("ntuple.root");  

  return mychain_data->Process("SelectorTest.C+"); //note the "+" }

and execute it with
  root -l mymain.C

Rene Brun

Marc Escalier wrote:
> Dear Rooters,
>
> i occur a problem of compilation when using a class created with a
> MakeSelector :
>
> SelectorTest.o: In function `SelectorTest::IsA() const':
> SelectorTest.C:(.text._ZNK12SelectorTest3IsAEv[SelectorTest::IsA()
> const]+0x7): undefined reference to `SelectorTest::Class()'
> SelectorTest.o:(.rodata._ZTV12SelectorTest[vtable for
> SelectorTest]+0xe8): undefined reference to
> `SelectorTest::ShowMembers(TMemberInspector&, char*)'
> SelectorTest.o:(.rodata._ZTV12SelectorTest[vtable for
> SelectorTest]+0xec): undefined reference to
> `SelectorTest::Streamer(TBuffer&)'
>
> while i don't occur with one created with MakeClass()
>
> Theses members are not in the class SelectorTest but rather in the
> TObject from which SelectorTest derivates
> An expert told me that the reason would be that the class created by
> MakeSelector would derive from "TObject"...
>
> would you have an idea of what is missing in my code and/or Makefile ?
>
> To make you loose the less time possible, i provide a very minimum
> standalone example here :
> lxplus :
>
> /afs/cern.ch/user/e/escalier/public/MinimalSelector
>
> any suggestion would be appreciated
>
> Thank you
>
> (
> just in case you would not have time to see the code on lxplus, the
> Makefile is :
> main: SelectorTest.o main.o
> /bin/rm -f main
> g++ -o main `root-config --ldflags --libs --glibs` -lRooFit
> -lRooFitCore -lMinuit main.o SelectorTest.o
>
> SelectorTest.o: SelectorTest.C
> g++ -c `root-config --cflags` SelectorTest.C
>
> main.o: main.C
> g++ -c `root-config --cflags` main.C
>
> clean: /bin/rm *.o
> )
>
Received on Tue Jul 13 2010 - 16:31:50 CEST

This archive was generated by hypermail 2.2.0 : Tue Jul 13 2010 - 23:50:01 CEST