TClonesArray

From: Ulrich Husemann (husemann@physik.uni-dortmund.de)
Date: Thu Sep 23 1999 - 18:24:41 MEST


Dear roottalk!

I am quite new with ROOT and I try to build a class of my own that
consists of objects called "tracks". To each track a TClonesArray of
so-called "hits" should be generated. This is analogous to the tutorial
"creation of a ROOT tree".
When I try to get a new instance of a "hit" in the TClonesArray by:

void Track::AddHit(Float_t x, Float_t y, Int_t superlayer)
{
  TClonesArray &hits = *fHits;
  new(hits[fnHits++]) Hit(x,y,superlayer);
}

I get the following error message from my linker:

./lib/muontest.Linux_intel.n.ARTE-03-01-r2/Track.o: In function
`Track::AddHit(float, float, int)':
./lib/muontest.Linux_intel.n.ARTE-03-01-r2/Track.o(.text+0x1af): undefined
reference to `Hit virtual table'
collect2: ld returned 1 exit status

???

Ulrich Husemann



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:39 MET