Re: Problem when compiling programs

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 27 Jun 2007 13:14:32 +0200


You must link with libRIO.so (see Release notes).

We strongly recommend to use the result of `root-config --libs` or `root-config --glibs` to be independent of the possible restructuring of the ROOT libs.

Rene Brun

??? wrote:
> Hello,everyone.
> I have installed ROOT(from the source code) on Fedora7. And
> everytime I want to compile sth. with the root lib, gcc complains a
> bunch of "undefined reference" in almost every .so lib file.
> And even a regular operation like "&" (gett the address) couuld
> rreturen an inlegal pointer.
>
> My gcc version is gcc4.1.2,and configured with:
> ../configure --prefix=/usr --mandir=/usr/share/man
> --infodir=/usr/share/info --enable-shared --enable-threads=posix
> --enable-checking=release --with-system-zlib --enable-__cxa_atexit
> --disable-libunwind-exceptions
> --enable-languages=c,c++,objc,obj-c++,java,fortran,ada
> --enable-java-awt=gtk --disable-dssi --enable-plugin
> --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
> --enable-libgcj-multifile --enable-java-maintainer-mode
> --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-cpu=generic
> --host=i386-redhat-linux
>
> and I compiled ROOT5.15.08 with this gcc.
> Has any one encountered problems like this?
> Any help will be appreciated:)
>
> for example, with this command to try to compile one program with
> gcc,the output could be like this:(all the varibers have been defined
> appropriately)
> ./g++ -o .$EXE $CXX -I${ROOTSYS}/include -I/usr/include/g++/
> -I${CLASSDIR}/HParticle -L${ROOTSYS}/lib -lCint -lCore -lHist -lMatrix
> -lPhysics -lTree -lEG -lRint -lm -ldl -L${CLASSDIR}/HParticle
> -lHParticle -L${CLASSDIR}/TField -lTField
>
> and it reports like this:
> /cern/root/lib/libTree.so: undefined reference to
> `TBufferFile::WriteArray(int const*, int)'
> /cern/root/lib/libTree.so: undefined reference to
> `TStreamerInfo::GetValueClones(TClonesArray*, int, int, int, int) const'
> /cern/root/lib/libTree.so: undefined reference to
> `TBufferFile::ReadArray(float*&)'
> /cern/root/lib/libTree.so: undefined reference to `TKey::Browse(TBrowser*)'
> /cern/root/lib/libTree.so: undefined reference to
> `TBufferFile::WriteArray(double const*, int)'
> /cern/root/lib/libTree.so: undefined reference to
> `TBufferFile::ReadStaticArray(long long*)'
> /cern/root/lib/libTree.so: undefined reference to
> `TKey::SetParent(TObject const*)'
> /cern/root/lib/libEG.so: undefined reference to
> `TPaveText::TPaveText(double, double, double, double, char const*)'
> /cern/root/lib/libTree.so: undefined reference to
> `TBufferFile::ReadStaticArray(long*)'
> /cern/root/lib/libTree.so: undefined reference to `typeinfo for TBufferFile'
> collect2: ld returned 1
>
>
>
>
Received on Wed Jun 27 2007 - 13:14:37 CEST

This archive was generated by hypermail 2.2.0 : Thu Jun 28 2007 - 17:50:02 CEST