Hello,
I have the following problem:
I installed root on ubuntu 12.04 root comiles (after a bit of trying) but when trying to compile my code I get error messages. Compiling single libraries (my own) works but when I try to compile the binary I get the following linker error message:
~/work/VubAnalysis/source/VubAnalysis_DatavsMC$ make
g++ DatavsMC.cc VubAnalysis_DatavsMC.cc -I../TMVA/ -Wall -w -O0 -DBABAR_COMP_INST -fno-exceptions -fPIC -I.. -pthread -m64 -I/home/thomas/work/computing/root/include -L../../lib/ -L../TMVA/lib/ -lTMVA.1 -L/home/thomas/work/computing/root/lib -lGpad -lHist -lGraf -lGraf3d -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lRIO -lNet -lThread -lCore -lCint -pthread -lm -ldl -rdynamic -lPidTables -lTXslFFReweighting -lMLP -lXMLIO -lTreePlayer -lMinuit -lVubAnalysis_Base -lVubHybrid -lVubReweighter -lVubCutter -g -o ../../bin/DatavsMC_test
/home/thomas/work/computing/root/lib/libTreePlayer.so: undefined reference to `TGaxis::TGaxis(double, double, double, double, double, double, int, char const*, double)'
/home/thomas/work/computing/root/lib/libMLP.so: undefined reference to `TMarker::TMarker(double, double, int)'
../../lib//libPidTables.so: undefined reference to `TLatex::TLatex(double, double, char const*)'
../../lib//libPidTables.so: undefined reference to `TLatex::GetXsize()'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDSSlnu_LLSW_m2::FromISGW2ToThisModel_D2()'
/home/thomas/work/computing/root/lib/libTreePlayer.so: undefined reference to `TPolyMarker3D::SetPoint(int, double, double, double)'
../../lib//libPidTables.so: undefined reference to `TCanvas::TCanvas(char const*, char const*, int, int)'
/home/thomas/work/computing/root/lib/libTreePlayer.so: undefined reference to `TPolyMarker3D::TPolyMarker3D(int, short, char const*)'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDlnu_CLN::~XSLBToDlnu_CLN()'
../../lib//libVubReweighter.so: undefined reference to `XSLPseudoScalarFF::FromISGW2ToThisModel()'
../../lib//libPidTables.so: undefined reference to `TPad::TPad(char const*, char const*, double, double, double, double, short, short, short)'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDstrlnu_DstrToDpi_CLN::FromSP8ToThisModel()'
../../lib//libPidTables.so: undefined reference to `TBox::TBox(double, double, double, double)'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDSSlnu_LLSW_m2::~XSLBToDSSlnu_LLSW_m2()'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDSSlnu_LLSW_m2::XSLBToDSSlnu_LLSW_m2(double, double, double, double, int, double, int, bool)'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDSSlnu_LLSW_m2::FromISGW2ToThisModel_D1prime()'
../../lib//libPidTables.so: undefined reference to `TBox::~TBox()'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDSSlnu_LLSW_m2::FromISGW2ToThisModel_D1()'
../../lib//libPidTables.so: undefined reference to `TLegend::TLegend(double, double, double, double, char const*, char const*)'
/home/thomas/work/computing/root/lib/libMLP.so: undefined reference to `TCanvas::TCanvas(char const*, char const*, int)'
../../lib//libPidTables.so: undefined reference to `TLegend::AddEntry(TObject const*, char const*, char const*)'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDlnu_CLN::XSLBToDlnu_CLN(double, double, double, double, double, double)'
../../lib//libPidTables.so: undefined reference to `TLine::TLine(double, double, double, double)'
/home/thomas/work/computing/root/lib/libTreePlayer.so: undefined reference to `TPolyMarker3D::TPolyMarker3D()'
/home/thomas/work/computing/root/lib/libTreePlayer.so: undefined reference to `TPaveText::TPaveText(double, double, double, double, char const*)'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDstrlnu_DstrToDpi_CLN::~XSLBToDstrlnu_DstrToDpi_CLN()'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDstrlnu_DstrToDpi_CLN::XSLBToDstrlnu_DstrToDpi_CLN(double, double, double, double, double, double, double, double, double)'
../../lib//libVubReweighter.so: undefined reference to `XSLKin::XSLKin(TLorentzVector, TLorentzVector, TLorentzVector, TLorentzVector)'
/home/thomas/work/computing/root/lib/libTreePlayer.so: undefined reference to `TView::CreateView(int, double const*, double const*)'
../../lib//libPidTables.so: undefined reference to `TLatex::~TLatex()'
../../lib//libPidTables.so: undefined reference to `TBox::TBox()'
/home/thomas/work/computing/root/lib/libMLP.so: undefined reference to `TText::TText(double, double, char const*)'
/home/thomas/work/computing/root/lib/libTreePlayer.so: undefined reference to `TText::Paint(char const*)'
../../lib//libVubReweighter.so: undefined reference to `XSLBToDSSlnu_LLSW_m2::FromISGW2ToThisModel_Dss0()'
/home/thomas/work/computing/root/lib/libTreePlayer.so: undefined reference to `TText::~TText()'
../../lib//libVubReweighter.so: undefined reference to `XSLKin::XSLKin(TLorentzVector, TLorentzVector, TLorentzVector)'
collect2: ld returned 1 exit status
make: *** [all] Error 1
Each of the libraries mentioned in the above error message compiled fine.
The code compiled fine on other systems. I tried both root 5.28h and 5.30. Both time the same issue.
I compiled root with that command (the default did not work):
./configure linuxx8664gcc --with-x11-libdir=/usr/lib/x86_64-linux-gnu/ --with-xpm-libdir=/usr/lib/x86_64-linux-gnu/ --with-xft-libdir=/usr/lib/x86_64-linux-gnu/ --with-xext-libdir=/usr/lib/x86_64-linux-gnu/ --enable-minuit2 --disable-xrootd
make -j2 LDFLAGS="-Wl,--no-as-needed"
My compiler version is:
g++ --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
I also exported the nessesary pathes:
export ROOTSYS=/home/thomas/work/computing/root/
export PATH=/home/thomas/work/VubAnalysis/bin/:$ROOTSYS/bin/:$PATH
export LD_LIBRARY_PATH=/home/thomas/work/VubAnalysis/lib/:$ROOTSYS/lib/:$LD_LIBRARY_PATH
Has anybody an idea what I could have done wrong?
Thanks,
Thomas