Hi guys,
Using 5.32/00 here.
I have a class in a namespace that I’m having trouble processing with rootcint. The class is defined as follows:
namespace DmtpcMath
{
class Rational
: public ROOT::Math::ParamFunction<ROOT::Math::IParamGradFunction> ,
public ROOT::Math::IGradientOneDim
{
...
ClassDef(Rational,1);
};
}
I have a ClassImp in the source file, and I have a Linkdef file with
#pragma link C++ namespace DmtpcMath;
#pragma link C++ class DmtpcMath::Rational+;
(I have a similar problem with both + and not + on the class in the Linkdef, so that’s not the issue).
When I attempt to compile the file generated by rootcint, I get the following error:
DmtpcMathCint.cc: In member function ‘virtual void DmtpcMath::Rational::ShowMembers(TMemberInspector&)’:
DmtpcMathCint.cc:162: error: ‘DmtpcMath::ROOT::Math’ has not been declared
DmtpcMathCint.cc:162: error: expected primary-expression before ‘:’ token
DmtpcMathCint.cc:162: error: expected `]' before ‘:’ token
DmtpcMathCint.cc:162: error: expected `)' before ‘:’ token
Line 162 in DmtpcMatchCint.cc is:
R__insp.GenericShowMembers("ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>", ( ::ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim> *) (this ), false);
I can get it to compile and work properly if I modify the rootcint output to the following: (note the :: in the template)
R__insp.GenericShowMembers("ROOT::Math::ParamFunction<ROOT::Math::IParametricGradFunctionOneDim>", ( ::ROOT::Math::ParamFunction< ::ROOT::Math::IParametricGradFunctionOneDim> *) (this ), false);
Suggesting that rootcint was generating improper code (although I don’t understand why it was picking the wrong namespace inside the template…). The problem happens even if I prefix the ROOT namespace with :: everywhere in my header file. Is there some way to work around this issue?
-Cosmin