Re: [ROOT] [root 3.03/09 and alphacxx6] multiply defined while building .so

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Feb 14 2003 - 16:05:59 MET


Hi Francois,

I suggest to use the same options to compile and build the shared lib
that we use for ROOT itself (see $ROOTSYS/config/Makefile.alphacxx6)

For example, to rebuild lib/libGraf3d.so, forcing recompilation of TBRIK.cxx

[ams] root > rm -f g3d/src/TBRIK.o
[ams] root > gmake
Running cint/MAKEINFO
cxx -O -tlocal -D__osf__ -D__alpha -Iinclude  -o g3d/src/TBRIK.o -c
g3d/src/TBRIK.cxx
cxx -shared -nocxxstd -Wl,-expect_unresolved,*,-msym,-soname,libGraf3d.so -O -o
lib/libGraf3d.so g3d/src/TAxis3D.o g3d/src/TBRIK.o g3d/src/TCONE.o
g3d/src/TCONS.o g3d/src/TCTUB.o g3d/src/TELTU.o g3d/src/TGLViewerImp.o
g3d/src/TGTRA.o g3d/src/TGeometry.o g3d/src/THYPE.o g3d/src/THelix.o
g3d/src/TMarker3DBox.o g3d/src/TMaterial.o g3d/src/TMixture.o g3d/src/TNode.o
g3d/src/TNodeDiv.o g3d/src/TPARA.o g3d/src/TPCON.o g3d/src/TPGON.o
g3d/src/TPadOpenGLView.o g3d/src/TPoints3DABC.o g3d/src/TPolyLine3D.o
g3d/src/TPolyMarker3D.o g3d/src/TRotMatrix.o g3d/src/TSPHE.o g3d/src/TShape.o
g3d/src/TTRAP.o g3d/src/TTRD1.o g3d/src/TTRD2.o g3d/src/TTUBE.o g3d/src/TTUBS.o
g3d/src/TUtil3D.o g3d/src/TXTRU.o g3d/src/X3DBuffer.o g3d/src/G__G3D.o
==> lib/libGraf3d.so done


Rene Brun

François Mauger wrote:
> 
> Hi, I'm François Mauger (IN2P3/Université of Caen),
> 
>     I'm a newbie with root (but not with C++).
>     Some colleagues and I aim to write a complete final
>     analysis framework for the DBD NEMO-3
>     experiment (NEAT: NEMO-3 Analysis Toolkit
>     -- I know, this name is not very original!)
>     Archs i use now are: alphacxx6 and linux (g++ 2.95-3.xx)
> 
> My problem now:
> 
> I wrote some classes "TNEATxxx(.h)(.C)".
> I get the "TNEATxxx.o"s it's ok!
> I autogenerate (via Gnu/make) the following LinkDef.h:
> 
> #ifdef __CINT__
> #pragma link off all globals;
> #pragma link off all classes;
> #pragma link off all functions;
> #pragma link C++ class TNEAT+;
> #pragma link C++ class TNEATEvent+;
> ...
> #pragma link C++ class TNEATRunInfo+;
> #endif
> 
> I then compile the "TNEAT***_Dict(.h)(.C)" files... maybe ok (not sure!)
> at least with no error nor warn messages!
> 
> When I try to build my "libNEATrawdata.so" library
> I get "multiply defined" errors, see the following dump:
> 
> cxx -Wl,-expect_unresolved,* -shared -O \
>   lib/TNEAT.o lib/TNEATEvent.o ... lib/TNEATRunInfo.o \
>   dict/TNEAT_Dict.o dict/TNEATEvent_Dict.o ... dict/TNEATRunInfo_Dict.o \
>   -o  ./lib/libNEATRawData.so
> ld (prelink):
> dict/TNEATEvent_Dict.o compressed: __T_5TNEAT: multiply defined
> dict/TNEATEvent_Dict.o compressed: __vtbl_5TNEAT: multiply defined
> dict/TNEATEvent_Dict.o compressed: TNEAT::ShowMembers(TMemberInspector&,
> char*): multiply defined
> dict/TNEATEvent_Dict.o compressed: TNEAT::Streamer(TBuffer&): multiply
> defined
> ...
> then tons of "multiply def"
> 
> There is probably something that I don't understand in the rootcint
> mechanism ;-(
> Is there a special order to use while building the whole stuff?
> How can I automate the right order if any?
> I hope my questions make sense!
> 
> Any hint to help me!
> 
> Thanks
> frc
> --
> François Mauger
> Laboratoire de Physique Corpusculaire de Caen et Université de Caen
> ENSICAEN/ISMRA - 6, Boulevard du Marechal Juin, 14050 CAEN Cedex, FRANCE
> e-mail: mauger@caelav.in2p3.fr
> tel.: (0/+33) 2 31 45 25 12
> fax: (0/+33) 2 31 45 25 49
> internet: http://www.physique.unicaen.fr/~fmauger/



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET