Re: [ROOT] TFitter / TMinuit Constructor problem

From: Christian Holm Christensen (
Date: Tue Nov 02 2004 - 18:35:14 MET

Hi Jiri, 

On Tue, 2004-11-02 at 16:51 +0100, Jiri Kvita wrote:
> Hello!
> Apologies for not specifying more, I am therefore resending my problem:
> I would like to ask whether there is a problem using TFitter and TMinuit
> in a Makefile-based compiled code?

Of course it is!  Whether you're using a Makefile or what not to compile
your stuff, is not really the issue.  

>  g++:
>  undefined reference to `TFitter::TFitter[in-charge](int)'
>  KCC:
>  undefined reference to `TFitter::__ct(int)'

Uh, KCC?  I thought that died ages ago?  Didn't Intel buy it, and
integrated the stuff into their own compiler (icc)? 

Anyway, you need to link to `-lMinuit' as well. 

	ROOTLIBS	= $(shell root-config --libs) -lMinuit 

> (similar feature occurs when trying to allocate TMinuit, but I suppose I 
> can use gMinuit when TFitter is initialized)

gMinuit is just a global pointer pointing to what ever fit algorithm you
set it to point to.  

TMinuit is also in `libMinuit', so the problem is the same. 

> I checked I have in my path in -L option.

Yes, but you need to specify that you want to link to it as well - it's
not enough to have it in the search path - the linker should actually
try search for it too :-)

Anyway, a better option is to use the TVirtualFitter interface: 

	TVirtualFitter* fitter = TVirtualFitter::Fitter(myObject, nPar);

This will per default load the Minuit library and use that as your fit
algorithm.   I think you can specify somewhere that it should rather use
`MyFantasticFitter' as your fitter if you like. 

 ___  |  Christian Holm Christensen 
  |_| |  -------------------------------------------------------------
    | |  Address: Sankt Hansgade 23, 1. th.  Phone:  (+45) 35 35 96 91
     _|           DK-2200 Copenhagen N       Cell:   (+45) 24 61 85 91
    _|            Denmark                    Office: (+45) 353  25 404
 ____|   Email:               Web:
 | |

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET