Re: problem with TLinearFitter in compiling .cxx file with makefile

From: Roel Aaij <Roel.Aaij_at_cern.ch>
Date: Tue, 10 Nov 2009 13:31:29 +0100


Hi Claudia

> I am working with ROOT 5.18 on a linux (Debian) machine and have the following problem:
> I tried to compile a .cxx file (with a Makefile.root) where I use the TLinearFitter (code: TLinearFitter *lf = new TLinearFitter(1);) and get the following error message:
>
> linexpfit_phi_err_fromfile.o: In function `main':
> linexpfit_phi_err_fromfile.cxx:(.text+0x9c7): undefined reference to `TLinearFitter::TLinearFitter(int)'
> collect2: ld returned 1 exit status
> make: *** [linexpfit_phi_err_fromfile] Error 1

This is not a compile error, but a linker error. You can fix it by adding -lMinuit to the command that includes the linker flags.

This is the same command as the compilation if you make a program out of the cxx file in one go. Otherwise it is different.

> At the beginning of the cxx file I include TLinearFitter.h and TVirtualFitter.h, so this cannot be the problem. Could someone help me, please?

This will only influence compilation, not linkage.

If you have further questions, please attach you makefile.

Greetz, Roel Aaij Received on Tue Nov 10 2009 - 13:32:04 CET

This archive was generated by hypermail 2.2.0 : Tue Nov 10 2009 - 17:50:03 CET