It seems to me that you must (pre)compile that example with ACLiC in order to use it (i.e. you get this error when you try to run it as “interpreted code”, i.e. without “++”). Try:
root [0] .x NumericalMinimization.cxx++
or:
root [0] .L NumericalMinimization.cxx++
root [1] NumericalMinimization();
[quote=“Pepe Le Pew”]It seems to me that you must (pre)compile that example with ACLiC in order to use it (i.e. you get this error when you try to run it as “interpreted code”, i.e. without “++”). Try:
root [0] .x NumericalMinimization.cxx++
or:
root [0] .L NumericalMinimization.cxx++
root [1] NumericalMinimization();[/quote]
Thanks Pepe Le Pew!
Unfortunately, it doesn’t work. If I input either one of what you say:
Info in TUnixSystem::ACLiC: creating shared library
Minuit2-5.20.00/inc/./NumericalMinimization_cpp.so
In file included from Minuit2-5.20.00/inc/./NumericalMinimization.cpp:3,
from Minuit2-5.20.00/inc/./fileCAYI7U.h:32,
from Minuit2-5.20.00/inc/./fileCAYI7U.cxx:16:
Minuit2-5.20.00/inc/./Math/Functor.h:340: error: expected class-name before ‘{’ token
Minuit2-5.20.00/inc/./Math/Functor.h:345: error: IBaseFunctionMultiDim' does not name a type Minuit2-5.20.00/inc/./Math/Functor.h:346: error:IBaseFunctionMultiDim’ has not been declared
Minuit2-5.20.00/inc/./Math/Functor.h:346: error: ISO C++ forbids declaration of BaseFunc' with no type Minuit2-5.20.00/inc/./Math/Functor.h:346: error: expected;’ before "ImplBase"
Minuit2-5.20.00/inc/./Math/Functor.h:413: error: ISO C++ forbids declaration of ImplBase' with no type ... ... ... Minuit2-5.20.00/inc/./Math/Functor.h: In constructorROOT::Math::Functor::Functor(const Func&, unsigned int) [with Func = double ()(const double)]’:
Minuit2-5.20.00/inc/./NumericalMinimization.cpp:25: instantiated from here
Minuit2-5.20.00/inc/./Math/Functor.h:371: error: invalid conversion from ROOT::Math::FunctorHandler<ROOT::Math::Functor, double (*)(const double*)>*' toint’
g++: Minuit2-5.20.00/inc/./fileCAYI7U.o: No such file or directory
Error in : Compilation failed!
Error: Function NumericalMinimization() is not defined in current scope :0:
*** Interpreter error recovered ***
It looks to me you are missing some header files. Are you using a standalone version, Minuit2-5.22 with a separate ROOT ? If you are using ROOT, you should use the Minuit2 version budge within ROOT, which you can enable by configure ROOT by doing ./configure --enable-minuit2
It looks to me you are missing some header files. Are you using a standalone version, Minuit2-5.22 with a separate ROOT ? If you are using ROOT, you should use the Minuit2 version budge within ROOT, which you can enable by configure ROOT by doing ./configure --enable-minuit2
Best Regards
Lorenzo[/quote]
Hi,
I think that’s the key. Besides, I wonder what the difference between classes TMinuit and ROOT::Math::Minimizer is. Thanks!