RE: [ROOT] compiling a Tselector derived class

From: Pietro Govoni (Pietro.Govoni@mib.infn.it)
Date: Fri Sep 03 2004 - 18:22:24 MEST


Dear Philippe, 

thank you very much for your explanation.

I tried to follow the ROOT Users Guide instructions and managed to
generate the dictionary successfully:

I put the ClassDef() and ClassImp() commands in the class e used rootcint.

What I cannot understand, even looking at the makefile, is what to do with
this dictionary, since if I try to compile

> c++ dataAnalysis.cpp dataAnalysis.C dataAnalysisDict.cxx `root-config
--cflags --libs`

I see the following errors.
WHat am I doing wrong?
Thanks again, 

pietro

/tmp/ccc54GpY.o(.text+0x0): In function `dataAnalysis::Init(TTree*)':
: multiple definition of `dataAnalysis::Init(TTree*)'
/tmp/cc6gYG1Z.o(.text+0x0): first defined here
/tmp/ccc54GpY.o(.text+0x290): In function `dataAnalysis::Notify()':
: multiple definition of `dataAnalysis::Notify()'
/tmp/cc6gYG1Z.o(.text+0x290): first defined here
/tmp/ccc54GpY.o(.text+0x50a): In function `dataAnalysis::Begin(TTree*)':
: multiple definition of `dataAnalysis::Begin(TTree*)'
/tmp/cc6gYG1Z.o(.text+0x50a): first defined here
/tmp/ccc54GpY.o(.text+0x6fc): In function
`dataAnalysis::SlaveBegin(TTree*)':
: multiple definition of `dataAnalysis::SlaveBegin(TTree*)'
/tmp/cc6gYG1Z.o(.text+0x6fc): first defined here
/tmp/ccc54GpY.o(.text+0x752): In function `dataAnalysis::Process(int)':
: multiple definition of `dataAnalysis::Process(int)'
/tmp/cc6gYG1Z.o(.text+0x752): first defined here
/tmp/ccc54GpY.o(.text+0xaee): In function
`dataAnalysis::SlaveTerminate()':
: multiple definition of `dataAnalysis::SlaveTerminate()'
/tmp/cc6gYG1Z.o(.text+0xaee): first defined here
/tmp/ccc54GpY.o(.text+0xaf4): In function `dataAnalysis::Terminate()':
: multiple definition of `dataAnalysis::Terminate()'
/tmp/cc6gYG1Z.o(.text+0xaf4): first defined here
collect2: ld returned 1 exit status




On Fri, 3 Sep 2004, Philippe Canal wrote:

>Hi Pietro,
>
>The error indicate that you did not generate the dictonary
>for the class dataAnalysis (See User's Guide, read about
>rootcint).
>
>Cheers,
>Philippe.
>
>Ps. A simplier solution is just to use ACLiC for the compilation
>by doing:
>	root [] .L dataAnalysis.C+
>
>Cheers,
>Philippe.
>
>-----Original Message-----
>From: owner-roottalk@pcroot.cern.ch
>[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Pietro Govoni
>Sent: Thursday, September 02, 2004 9:57 AM
>To: root mailing list
>Subject: [ROOT] compiling a Tselector derived class
>
>
>Dear ROOTers,
>
>I am trying to compile the following code:
>
>#include "dataAnalysis.h"
>int main()
>{}
>
>where dataAnalysis.h is a TSelector derived class, that I created and
>didn't change.
>
>I compile it with the command:
>
>[govoni@fly codice> c++ dataAnalysis.cpp dataAnalysis.C `root-config
>--cflags --libs`
>/tmp/ccMzj76K.o(.gnu.linkonce.d.__vt_12dataAnalysis+0xdc): undefined
>reference to `dataAnalysis::ShowMembers(TMemberInspector &, char *)'
>/tmp/ccMzj76K.o(.gnu.linkonce.d.__vt_12dataAnalysis+0xe0): undefined
>reference to `dataAnalysis::Streamer(TBuffer &)'
>/tmp/ccMzj76K.o: In function `dataAnalysis::IsA(void) const':
>/tmp/ccMzj76K.o(.dataAnalysis::gnu.linkonce.t.IsA(void) const+0xa): undefined
>reference to `dataAnalysis::Class(void)'
>/tmp/ccMzj76K.o: In function `dataAnalysis::StreamerNVirtual(TBuffer &)':
>/tmp/ccMzj76K.o(.dataAnalysis::gnu.linkonce.t.StreamerNVirtual(TBuffer
>&)+0x12): undefined reference to `dataAnalysis::Streamer(TBuffer &)'
>collect2: ld returned 1 exit status
>
>
>
>with ROOT:
>
>  *******************************************
>  *                                         *
>  *        W E L C O M E  to  R O O T       *
>  *                                         *
>  *   Version   4.00/08       9 July 2004   *
>  *                                         *
>  *  You are welcome to visit our Web site  *
>  *          http://root.cern.ch            *
>  *                                         *
>  *******************************************
>
>
>I don't understand how to compile successfully.
>What should I do?
>
>Thank you very much
>
>pietro
>
>



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET