Compile time error with TTree

Hello. I have a program with a function called writeTree. The function has the lines:

TFile *f = new TFile(fname,"RECREATE"); TTree *tree = new TTree(treeName,treeTitle);

When I compile, I get the following error:

g++ -ldl -lm -L/root/software/root/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGpad -lMatrix -lMathCore -lThread -lGui -pthread -o va_test ./tmp/main.o ./tmp/okFrontPanelDLL.o ./tmp/va_test.o ./tmp/xem_wrapper.o ./tmp/tek_user.o ./tmp/vxi11_user.o ./tmp/vxi11_clnt.o ./tmp/vxi11_xdr.o ./tmp/autoTest.o ./tmp/test.o ./tmp/autoTest.o: In function `writeTree(Capture**, int, int, int)': /root/software/linavat/va_test/more_src/autoTest.cpp:1088: undefined reference to `TTree::TTree(char const*, char const*, int)' collect2: ld returned 1 exit status

Has anyone seen this before? Thanks!

My mistake! I just didn’t have -lTree. Sorry.