Re: Templated member functions in root.

From: Brett Viren <bv_at_bnl.gov>
Date: Fri, 18 Feb 2005 11:47:26 -0500


Hi Philippe,

Philippe Canal <pcanal_at_fnal.gov> writes:

>

> There was a bug in CINT (the fix will be uploaded shortly in the CVS
> repository),
> which allowed CINT to only see the first declared method of the correct name
> when the template argument is explicit set.

Thanks for your continued help on this, but it looks like as of today's CVS the problem has reversed itself. Now only the second, 2D Book<>() seems to get picked up.

I've distilled the issue to just a couple standalone files (attached). Here is a session showing how to reproduce the problem:



bviren_at_coop:HistMan> tar -xzvf bug.tgz
bug/
bug/LinkDef.h
bug/Foo.h

bviren_at_coop:HistMan> cd bug
bviren_at_coop:bug> rootcint -f FooCint.cc -c -I. -I$ROOTSYS/include Foo.h LinkDef.h Warning: #pragma link, function Book<TH2D>(const char*,const char*,int,Axis_t,Axis_t,int,Axis_t,Axis_t,const char*) not found FILE:LinkDef.h LINE:9 bviren_at_coop:bug> g++ -I. -I$ROOTSYS/include -o FooCint.o FooCint.cc Foo.h: In member function `THType* Foo::Book(const char*, const char*, int,

   double, double, int, double, double, const char*) [with THType = TH1D]': FooCint.cc:182: instantiated from here Foo.h:21: error: no matching function for call to `TH1D::TH1D(const char*&,

   const char*&, int&, Axis_t&, Axis_t&, int&, Axis_t&, Axis_t&)' /usr/local/opt/root-devel/include/TH1.h:498: error: candidates are:

   TH1D::TH1D(const TH1D&)
/usr/local/opt/root-devel/include/TH1.h:497: error:

   TH1D::TH1D(const TVectorD&)
/usr/local/opt/root-devel/include/TH1.h:496: error:

   TH1D::TH1D(const char*, const char*, int, const Double_t*) /usr/local/opt/root-devel/include/TH1.h:495: error:

   TH1D::TH1D(const char*, const char*, int, const Float_t*) /usr/local/opt/root-devel/include/TH1.h:494: error:

   TH1D::TH1D(const char*, const char*, int, double, double) /usr/local/opt/root-devel/include/TH1.h:493: error:

   TH1D::TH1D()
bviren_at_coop:bug> root-config --version
4.03/02
bviren_at_coop:bug> root


Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.159, Nov 14 2004 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }. root [0]


-Brett.

Received on Fri Feb 18 2005 - 17:47:44 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:05 MET