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 to
TH1F::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.