RE: [ROOT] rootcint, STL and missing streamers

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri Sep 06 2002 - 19:54:44 MEST


Hi,

This is a problem similar to the one reported by David Morrison (see
http://root.cern.ch/root/roottalk/roottalk02/3696.html).

In your case, it is the template list<...> and allocator which is
instantiation has a side effect of:

   #pragma link C++ class ObjectProcessor<PhysicsObject>;

We are trying to figure out a better solution (than forcing the
instantiation and/or explicitly linking off the side effects.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Roger Moore
Sent: Wednesday, August 21, 2002 3:30 PM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] rootcint, STL and missing streamers


Using ROOT v3.05.00 I've noticed a strange problem when using templated
classes containing STL vectors. Unless rootcint is passed a class which
inherits from the template using the specified parameter.

In my case the LinkDef.h file containing the lines:

#pragma link C++ class PhysicsObject;
#pragma link C++ class ObjectProcessor<PhysicsObject>;

Where 'ObjectProcessor' is a template class containing an STL list
pointers of the type of the template parameter (i.e. std::list<T*>).

This generates the following ROOTCINT errors:

Class allocator<PhysicsObject*>: Streamer() not declared
Class allocator<PhysicsObject*>: ShowMembers() not declared
Class allocator<PhysicsObject*>: Class_Name() and initialization object
not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >: Streamer() not
declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >: ShowMembers() not
declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >: Class_Name() and
initialization object not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >::iterator:
Streamer() not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >::iterator:
ShowMembers() not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >::reverse_iterator:
Streamer() not declared
Class list<PhysicsObject*,allocator<PhysicsObject*> >::reverse_iterator:
ShowMembers() not declared

However if I add the line:

class Dummy001 : public ObjectProcessor<PhysicsObject> { };

at the start of the LinkDef.h file then all these errors go away.
Similarly I have to include this line for each instance of the template
that I want to create.

This seems to be a bug...

Roger



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:08 MET