Re: [ROOT] rootcint, templates and multiply defined symbols

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Fri Aug 23 2002 - 16:56:31 MEST


Hi Dave,

  here the answer of Masa on how to solve your problem.

Cheers, Fons.

-- 
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


attached mail follows:


Hello Fons, It works as follows. #pragma link off all globals; #pragma link off all classes; // everything defined before this point // is turned off #pragma link off all functions; #pragma link C++ class B<int>-!; // B<int> and A<int> are instantiated // they are, by default, turned on for the linkage. So, both A<int> is exposed. #pragma link off class A<int>; // you need this line to turn off A<int> Thank you Masaharu Goto ----- Original Message ----- From: "Fons Rademakers" <Fons.Rademakers@cern.ch> To: "Masaharu Goto" <MXJ02154@nifty.ne.jp> Sent: Thursday, August 22, 2002 10:46 PM Subject: why export of A<int>... > Hi Masa, > > see the following 5 files. Put them in a directory and run make. > Why is in BDict.C besides B<int> also A<int> exported while not > specified in the BLinkDef.h. Because of this the link fails with > multiple defined functions coming from ADict.C. > > Removing the templates everything works fine. > > Is this expected behaviour for templated classes? Is so we would need an > option to disable explicit generation of a specific instance. > > > Cheers, Fons. > > > Cheers, Fons. > > -- > 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:51:05 MET