Trouble getting started with the TLinearFitter class

Hello,

I am having trouble using the TLinearFitter class.

This trouble is really fundamental. So, I expect, that I
am not setting this up correctly.

Can anyone give me a short example of how to use this class?

Here is my sample code. It won’t compile.

#include “TLinearFitter.h”
#include “TApplication.h”

int main(int argc,char **argv){

TApplication theApp(“App”, &argc, argv);

TLinearFitter *lf = new TLinearFitter();

return 0;

}

Given tha compiler command:
g++ -o lfTest -L/home/demiller/ROOT5.06.00/root/lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lGui -pthread -lm -ldl -rdynamic -pthread -I/home/demiller/ROOT5.06.00/root/include lfTest.cc

I get these compiler errors:
/tmp/ccmmrlKS.o(.text+0x4e): In function main': : undefined reference toTLinearFitter::TLinearFitter()'
collect2: ld returned 1 exit status

What have I left out?

Thank you.

-David Eric Miller

You forgot -lMinuit in your link procedure.

To find the library containing a class look at $ROOTSYS/etc/system.rootmap, eg

grep TLinearFitter *.rootmap
The library is the first one referenced in the list of libs, the others in the list are the libs required also

Rene

Hello.

Thank you Rene. This is indeed the problem.

I am curious, however. The actual command I used to compile was not:

g++ -o lfTest -L/home/demiller/ROOT5.06.00/root/lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lGui -pthread -lm -ldl -rdynamic -pthread -I/home/demiller/ROOT5.06.00/root/include lfTest.cc

But rather:
g++ -o lfTest root-config --cflags root-config --glibs lfTest.cc

Is there another root-config --???? I can use to make this process more
automatic?

Thanks again,

-David Eric Miller