ROOT and Athena


I’m trying to compile a simple ROOT code inside CERN’s CMT envitonment and I come up with an undefined reference error.

My setup is like this:
cmt, src and header directories. Inside src dir: run.cxx which is the application.

cmt requirements file:
package CSC_Test

use AtlasPolicy AtlasPolicy-01-*
use GaudiInterface GaudiInterface-01-* External
use AtlasROOT AtlasROOT-* External
use AtlasCLHEP AtlasCLHEP-* External
library CSC_Test *.cxx

apply_pattern installed_library

create executable

application run run.cxx

#include "TH1F.h"

int main(int argc, char* argv[])
	TH1F *p_hist=new TH1F("HistName","Hist_Title",10,0,10);
	return 0;

Error Message:
g++ -Wl,-Bdynamic -Wl,–export-dynamic -o …/i686-slc3-gcc323-opt/run.o […] -L/afs/ […];
mv -f run.exe
…/i686-slc3-gcc323-opt/run.o(.text+0x47): In function main': : undefined reference toTH1F::TH1F(char const*, char const*, int, double, double)‘
collect2: ld returned 1 exit status
mv: cannot stat `’: No such file or directory

What am I doing wrong? Should I be asking this someplace else?


You should post this type of problem to one of the Atlas news group.
There is nothing such as “CERN CMT”. This is an Atlas tool.
To compile, link and run your small application, do

g++ -o run.exe run.cxx -I$ROOTSYS/include -L$ROOTSYS/lib -lCore -lCint -lHist -ldlwhere ROOTSYS points to eg to