Linking problems when linking against ROOT libraries

I made my a program which I am trying to link against ROOT (installed from binaries) libraries.
I should say that I didn’t have this problem when using a compiled version of root.
My system is:
Intel, RedHat 9 (Shrike)

Root Version is:

The Compile&linking command and the Error are:
g++ -g -fPIC -Wall -o RootClean RootClean.C -pthread -I/afs/ipp/mpe/gamma/instruments/integral/isdc/osa/osa-5.0/linux_sw-5.0/root//include -Wno-long-long -Wall -I/afs/ -I/afs/ipp/mpe/gamma/instruments/integral/isdc/osa/osa-5.0/linux_sw-5.0/root//geom/inc -I/afs/ -I/afs/ipp/mpe/gamma/instruments/integral/isdc/osa/osa-5.0/linux_sw-5.0/root//include -L/afs/ipp/mpe/gamma/instruments/integral/isdc/osa/osa-5.0/linux_sw-5.0/root//lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lGui -pthread -lm -ldl -rdynamic -lHtml -lGeom -L/afs/ -lcfitsio_3.003 -Wno-long-long
RootClean.C: In function int SimpleFit(float*, int*, TH2F*, int&, double*, int)': RootClean.C:522: warning: unused variableint nofbasicpar’
/afs/ipp/mpe/gamma/instruments/integral/isdc/osa/osa-5.0/linux_sw-5.0/root//lib/ undefined reference to std::basic_istream<char, std::char_traints<char> >::seekg(std::fpos<mbstate_t>)' /afs/ipp/mpe/gamma/instruments/integral/isdc/osa/osa-5.0/linux_sw-5.0/root//lib/ undefined reference tostd::basic_ostream<char, std::char_traits >::seekp(std::fpos<mbstate_t>)'
collect2: ld returned 1 exit status


This looks like an inconsistency between the compiler used to compile the ROOT binary tar file and your local compiler.
You should recompile ROOT from source.

Can you run the standard ROOT tutorials ?


Hi Rene,
yes I can run the tutorials and even compile the examples in the test direcory.
So I’d say Root is working normally.
It looks very strange. I would have already installed a compiled version if I had the permissions :slight_smile:.
So I was trying to use the compiled version.