Re: [ROOT] IO Problem with a TObjArray of non-TObjects

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Thu Apr 11 2002 - 15:15:30 MEST


So it works if the main program is also compiled with -fPIC?

Cheers, Fons.



On Thu, 2002-04-11 at 14:14, David Chamont wrote:
> Rene Brun wrote:
> 
> > Hi David,
> >
> > I have no problems executing you small test program. I do:
> >
> > rootcint -f cint.cxx -c RtObj.h LinkDef.h
> > g++ -fPIC -I$ROOTSYS/include -c cint.cxx mytest.cxx
> > g++ -o mytest mytest.o cint.o `root-config --glibs`
> 
> After a long pursues, it appears that the differences
> between what is done above and what is done by my build
> system is the use of a shared library for the RtObj
> and LinkDef products, and the no-use of -fPIC when
> compiling the main program file source.
> So, the recipe to get the crash :
> 
> - put ClassImpT in the header file.
> - ask an explicit instanciation of RtObj<TString> in one of the body file.
> - group everything except the main program in a shared library.
> - do not use -fPIC when compiling the main program.
> 
> If one of the ingredient is lacking, the program works
> apparently fine. I attach below a tar file which demonstrate the
> crash.
> 
> David.
> 
> 
-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7679480



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:49 MET