Re: Compiling ROOT "test" programs on Linux

Joachim Kuth (kuth@physik.rwth-aachen.de)
Fri, 28 May 1999 23:51:12 +0200 (MET DST)


On Fri, 28 May 1999, Andre C. McNeill wrote:

>
> Peace, I am trying to compile the "test" progams in the test directory
> with gmake, under the Linux operating system, and these are the errors it
> gives me
>
> ______________________________________________________________________________
>
> > gmake
> g++ -shared -g Event.o EventDict.o -o libEvent.so
> g++ -g MainEvent.o Event.o EventDict.o -L/home/andre/root/lib -lNew -lBase
> -lCint -lClib -lCont -lFunc -lGraf -lGraf3d -lHist -lHtml -lMatrix -lMeta
> -lMinuit -lNet -lPostscript -lProof -lTree -lUnix -lZip -lm -ldl -rdynamic
> -o Event
> MainEvent.o: In function `main':
> MainEvent.o(.text+0x263): undefined reference to `TFile::TFile(char const
> *, char const *, char const *, int)'
> MainEvent.o(.text+0x476): undefined reference to `TFile::TFile(char const
> *, char const *, char const *, int)'
> MainEvent.o(.text+0x51e): undefined reference to
> `TDirectory::TDirectory(char const *, char const *, char const *)'
> /home/andre/root/lib/libBase.so: undefined reference to `__log1p'
> collect2: ld returned 1 exit status
> gmake: *** [Event] Error 1
> ______________________________________________________________________________
>
> Can anyone explain why it is not recognizing the TFile or TDirectory
> declarations from the TDirectory.h in the MainEvent.cxx file?
>
> Thank you for your time. Peace.
>
> Andre McNeill
>
>
Hi Andre,

the prototypes from TDirectory.h are recognized. It is the linker that
complains about the missing constructors. Probably you are mixing
include files of one Root version with libs of another one.
As far as I know the cons in question were added recently.

As a check, do (at your shell prompt) something like:

[foo@bar]$ nm -C $ROOTSYS/lib/libBase.so | grep TFile\(

which should yield

00037ed4 T TFile::~TFile(void)
0003798c T TFile::TFile(void)
00037a38 T TFile::TFile(char const *, char const *, char const *, int)
00037e88 T TFile::TFile(TFile const &)

and
[foo@bar]$ nm -C $ROOTSYS/lib/libBase.so | grep TDirectory\(

which should yield

000329fc T TDirectory::~TDirectory(void)
000326ac T TDirectory::TDirectory(void)
00032728 T TDirectory::TDirectory(char const *, char const *, char const *)
00032988 T TDirectory::TDirectory(TDirectory const &)

at least if you have Version 2.21/08 built 18 March 1999.

As stated before, older libBase.so lacks the cons your linker complains about.

Hope this helps,

Joachim Kuth (Joachim.Kuth@physik.rwth-aachen.de)
III. Physikalisches Institut der RWTH Aachen

SINDRUM 2: Search for leptonflavour-violating processes