class MyFCN: public ROOT::Fit::Chi2Function{
public:
MyFCN(const ROOT::Fit::BinData& data, const ROOT::Fit::Chi2Function::IModelFunction& func): ROOT::Fit::Chi2Function(data,func) {}
~MyFCN(){}
};[/code]
but I get this error:
root [0] .L myfun.C++
Info in <TUnixSystem::ACLiC>: creating shared library ./myfun_C.so
./myfun_C_ACLiC_dict.cxx: In function ‘int G__myfun_C_ACLiC_dict_2429_0_1(G__value*, const char*, G__param*, int)’:
./myfun_C_ACLiC_dict.cxx:151: error: no matching function for call to ‘MyFCN::MyFCN(ROOT::Fit::BinData&, int&)’
./myfun.C:7: note: candidates are: MyFCN::MyFCN(const ROOT::Fit::BinData&, const ROOT::Math::IParamMultiFunction&)
./myfun.C:5: note: MyFCN::MyFCN(const MyFCN&)
./myfun_C_ACLiC_dict.cxx:153: error: no matching function for call to ‘MyFCN::MyFCN(ROOT::Fit::BinData&, int&)’
./myfun.C:7: note: candidates are: MyFCN::MyFCN(const ROOT::Fit::BinData&, const ROOT::Math::IParamMultiFunction&)
./myfun.C:5: note: MyFCN::MyFCN(const MyFCN&)
g++:./myfun_C_ACLiC_dict.o: No such file or directory
Error in <ACLiC>: Compilation failed!
What is the problem? I guess that it is something “obvious” but I can’t figer out what it is
there is an error in generating from ACLIC in generating the dictionary for your macro. I need to see also your code, myfun.C and in particular the line where you construct the MyFCN class.
Do you correctly declare the function type passed in the constructor ?
It seems it is interpreted by the compiler as an int
This is exatly what is confusing me because
myfun.C looks just like (see also attachment):
[code]#include “Fit/Chi2FCN.h”
class MyFCN: public ROOT::Fit::Chi2Function{
public:
MyFCN(const ROOT::Fit::BinData& data, const ROOT::Fit::Chi2Function::IModelFunction& func): ROOT::Fit::Chi2Function(data,func) {}
~MyFCN(){}
};
[/code]
i.e. I don’t even try to construct the MyFCN class. I just wanted to load it first (.L myfun.C++). So I’m litle bit confused why it is not possible to compile (load) this class
This is actually a deficiency in the way rootcint is used by ACLiC. I will be looking for a solution, in the meantime could report this is issue in savannah.cern.ch to keep track of it.
and run this script (python loadmyfcn.py) then it is not possible to compile it:
Info in <TUnixSystem::ACLiC>: creating shared library /home/jiri/workspace/./myfcn_C.so
/home/jiri/workspace/./myfcn_C_ACLiC_dict.cxx: In function ‘int G__myfcn_C_ACLiC_dict_2429_0_1(G__value*, const char*, G__param*, int)’:
/home/jiri/workspace/./myfcn_C_ACLiC_dict.cxx:151:95: error: no matching function for call to ‘MyFCN::MyFCN(ROOT::Fit::BinData&, int&)’
/home/jiri/workspace/./myfcn.C:5:5: note: candidates are: MyFCN::MyFCN(const ROOT::Fit::BinData&, const ROOT::Fit::Chi2FCN<ROOT::Math::IBaseFunctionMultiDim>::IModelFunction&)
/home/jiri/workspace/./myfcn.C:3:44: note: MyFCN::MyFCN(const MyFCN&)
/home/jiri/workspace/./myfcn_C_ACLiC_dict.cxx:153:108: error: no matching function for call to ‘MyFCN::MyFCN(ROOT::Fit::BinData&, int&)’
/home/jiri/workspace/./myfcn.C:5:5: note: candidates are: MyFCN::MyFCN(const ROOT::Fit::BinData&, const ROOT::Fit::Chi2FCN<ROOT::Math::IBaseFunctionMultiDim>::IModelFunction&)
/home/jiri/workspace/./myfcn.C:3:44: note: MyFCN::MyFCN(const MyFCN&)
g++: /home/jiri/workspace/./myfcn_C_ACLiC_dict.o: No such file or directory
Error in <ACLiC>: Compilation failed!
It looks like the same problem/errors as before when one wanted to compile the class under CINT. Now it works under CINT but it doesn’t work if one use pyroot. Is there any solution?
[quote]and run this script (python loadmyfcn.py) then it is not possible to compile it:[/quote]Since the 2 operations are the same (your python code is calling the exact same thing as CINT), the only plausible issue is that in your 2nd case an older version of rootcint and/or libCint.so is still located on your PATH or LD_LIBRARY_PATH.