Re: [ROOT] Problem with rootcint and derived

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Tue Apr 25 2000 - 13:08:44 MEST


Hi Gora,

   the order in the LinkDef file is significant especially for the case you
encountered. Make sure that the pragma for class A is before the one of class B
in the same LinkDef file.

-- Fons



Masaharu Goto wrote:
> 
> Hello Gora,
> 
> The 'template<>' thing is compiler version dependent. Current rootcint/makecin
> t
> causes warning for new compiler, but if we add 'template<>', we will have
> error in the old compiler.  I think we should keep this behavior until all of
> supported compiler handles 'template<>'.
> 
> The other problem, I home Rene or Fons will answer.
> 
> Thank you
> Masaharu Goto
> 
> >
> >Hello,
> >  I have been having some strange mail problems in sending messages to ROOT
> >talk and to the ROOT maintainers. What is the canonical address to send
> >messages to the mailing list? This one is being sent to an address found by
> >searching for "roottalk" on the Web page. Shouldn't the Majordomo welcome
> >message that I carefully preserved contain this information?
> >
> >  I have run into a problem with rootcint in deriving template classes from a
> >base class. Attached to these messages are the following files containing a
> >trivial example that reproduces the problem:
> >  classA.cxx, classA.h   Base template class
> >  classALinkDef.h        rootcint LinkDef file for classA
> >  classB.cxx, classB.h   Template class derived from classA
> >  classBLinkDef.h        rootcint LinkDef file for classB
> >  Makefile               simple Makefile for all programs
> >You can try compiling these simply by typing 'make' at a Linux command prompt
> .
> >I am using ROOT v2.23 on a Linux box (Suse 6.2, kernel 2.2.10) with g++
> 2.95.1.
> >Here are the g++ warnings and errors that I get:
> >classADict.cxx:22: warning: explicit specialization not preceded by `template
> 
> <>'
> >classADict.cxx:34: warning: explicit specialization not preceded by `template
> 
> <>'
> >classADict.cxx:44: warning: explicit specialization not preceded by `template
> 
> <>'
> >...
> >
> >classBDict.cxx:31: warning: explicit specialization not preceded by `template
> 
> <>'
> >classBDict.cxx:45: warning: explicit specialization not preceded by `template
> 
> <>'
> >classBDict.cxx:56: warning: explicit specialization not preceded by `template
> 
> <>'
> >classBDict.cxx:66: warning: explicit specialization not preceded by `template
> 
> <>'
> >classBDict.cxx:66: specialization of TClassA<int>::Streamer(TBuffer &) after
> instantiation
> >classBDict.cxx:66: explicit specialization of TClassA<int>::Streamer(TBuffer
> &) after first use
> >classBDict.cxx:78: warning: explicit specialization not preceded by `template
> 
> <>'
> >classBDict.cxx:78: specialization of
> TClassA<int>::ShowMembers(TMemberInspector &, char *) after instantiation
> >classBDict.cxx:78: explicit specialization of
> TClassA<int>::ShowMembers(TMemberInspector &, char *) after first use
> >classBDict.cxx:88: warning: explicit specialization not preceded by `template
> 
> <>'
> >make: *** [all] Error 1
> >
> >The warnings can be fixed by adding "template <>" before the appropriate
> >functions. The error results from TClassA<int>::Streamer() being used before
> >it is defined, and can be fixed by moving the TClassB<int>::Streamer()
> >definition to after the TClassA<int>::Streamer() definition. It would be nice
> >if rootcint would do these automatically. Thanks in advance.
> >
> >Regards,
> >Gora
> >

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:24 MET