RE: Templated member functions in root.

From: Philippe Canal <>
Date: Fri, 18 Feb 2005 12:07:12 -0600

Hi Brett,

Thanks for reporting this problem. The fix will be uploaded shortly in the CVS repository. As a work-around you just have to use 2 dictionary (one for the class and one for templated member functions).


-----Original Message-----
From: Brett Viren [] On Behalf Of Brett Viren Sent: Friday, February 18, 2005 10:47 AM To: Philippe Canal
Subject: Re: [ROOT] Templated member functions in root.

Hi Philippe,

Philippe Canal <> 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
> 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

bviren_at_coop:HistMan> cd bug
bviren_at_coop:bug> rootcint -f -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 Foo.h: In member function `THType* Foo::Book(const char*, const char*, int,

   double, double, int, double, double, const char*) [with THType = TH1D]': 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:

bviren_at_coop:bug> root-config --version
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 - 19:09:14 MET

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