Minuit2 with ROOT5.17 : problem using FCN class


I have created a shared library for the class which implements the FCN minimization function (Decmass222Fcn below), to use with Minuit2. After loading the library and execute my macro within ROOT, i get an error for the FCN class member function:
virtual double operator() (const std::vector& ) const;

Inside the macro, I instantiate theFcn object as:

[code]Decmass222Fcn *theFcn = new Decmass222Fcn(smmasses, endpoints, endptsind);

// blabla

std::vector theParameters;
double chi2;


chi2 = theFcn->operator()(theParameters);


and the error I get is:
Error: operator()() header declared but not defined

In addition, there is a warning for missing dictionary for the class ROOT::Minuit2::GenericFunction.

Is the error related with this warning? And what am I doing wrong?

Thank you very much!


can you send me please the code which implements the FCN, class Decmass222Fcn ?
It looks to me you have defined in the header file of that class a function
operator() () .
You must define and implement a member function :

double operator() (const std::vector & ) const;

The class Decmass222Fcn must also not be an interpreted function.
You must either run all your code in compiled mode or you load first the code implementing your function. If the function is implemented in a file
Decmass222Fcn.C, you have to do before running your macro:

.L Decmass222Fcn.C+

Best Regards


For the record, the problem is solved now thanks to Lorenzo Moneta who had a look at the code :
the particular problem was solved by running the macro in compile mode so that the dictionaries for some Minuit2 classes used were generated .

Thanks, cheers