ROOT and Athena

Hi,

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
Code:

#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 run.exe.new …/i686-slc3-gcc323-opt/run.o […] -L/afs/cern.ch/sw/lcg/external/root/5.10.00e/slc3_ia32_gcc323/root/lib […];
mv -f run.exe.new 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 `run.exe.new’: No such file or directory

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

N.

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
/afs/cern.ch/sw/lcg/external/root/5.10.00e/slc3_ia32_gcc323/root

Rene