Hi Sebastien,
Due to circular dependencies in your includes, remove the unnecessary
lines
ClassImp(MCParticle) ; in MCParticle.c
ClassImp(Particle) in Particle.C
and implement your MCParticle copy constructor in MCParticle.h
MCParticle(const MCParticle & amcparticle) {/here dummy but OK)
Rene Brun
On
Sat, 22 Feb 2003, Sebastien Greder wrote:
> Hello,
>
> I'm getting troubles at the compilation step with a very simple code.
> Unfortenatly the compilation error message is quite misty for me.
>
> A small tar file can be found under :
>
> /afs/in2p3.fr/home/g/greder/public/test.tar.gz
>
> cd in compile directory and start a root session :
>
> .x Compile_package.C
>
> you will get this message :
>
> ************************
> * STARTING PACKAGE *
> * COMPILATION *
> ************************
> removing `../lib/Physics_Objects_C.so'
> Info in <TUnixSystem::ACLiC>: creating shared library
> /home/greder/boulot/analyse/my_analyze/test/compile/./../physics_objects/Physics_Objects_C.so
> In file included from
> /home/greder/boulot/analyse/my_analyze/test/compile/./../physics_objects/Physics_Objects.C:2,
> from
> /home/greder/boulot/analyse/my_analyze/test/physics_objects/file9ApYOs.h:29,
> from
> /home/greder/boulot/analyse/my_analyze/test/compile/./../physics_objects/file9ApYOs.cxx:13:
> /home/greder/boulot/analyse/my_analyze/test/physics_objects/mc_particle/MCParticle.C:5:
> redefinition of
> `int ROOT::R__dummyintdefault5'
> /home/greder/boulot/analyse/my_analyze/test/physics_objects/particle/Particle.C:5:
> `int
> ROOT::R__dummyintdefault5' previously defined here
> /home/greder/boulot/analyse/my_analyze/test/physics_objects/mc_particle/MCParticle.C:5:
> multiple
> initializations given for `ROOT::R__dummyintdefault5'
> /home/greder/boulot/analyse/my_analyze/test/physics_objects/mc_particle/MCParticle.C:5:
> redefinition of
> `class ROOT::R__dummyintdefault5_c'
> /home/greder/boulot/analyse/my_analyze/test/physics_objects/particle/Particle.C:5:
> previous definition
> here
> /home/greder/boulot/analyse/my_analyze/test/compile/./../physics_objects/file9ApYOs.cxx:
> In method
> `MCParticle::MCParticle (const MCParticle &)':
> /home/greder/boulot/analyse/my_analyze/test/compile/./../physics_objects/file9ApYOs.cxx:658:
> call of
> overloaded `Particle(const MCParticle &)' is ambiguous
> /home/greder/boulot/analyse/my_analyze/test/physics_objects/particle/Particle.C:20:
> candidates are:
> Particle::Particle (const Particle &)
> /home/greder/boulot/analyse/my_analyze/test/physics_objects/particle/Particle.C:34:
> Particle::Particle (TLorentzVector, int = 1, int = 0)
> g++:
> /home/greder/boulot/analyse/my_analyze/test/compile/./../physics_objects/file9ApYOs.o:
> No such file or directory
> Error in <ACLiC>: Compilation failed!
>
> I don't even understand why there is a claim about the copy constructor.
>
> if now you go in the directory physics_objects/ and
> you commnent in the file Physics_Objects.C teh line :
>
> #include "mc_particle/MCParticle.C"
>
> and in the file Physics_Objects_linkdef.h the line :
>
> #pragma link C++ class MCParticle+;
>
> to avoid the compilation of the class MCParticle
>
> everything works fine.
>
> I really cannot figure out where the pb stands,
>
> help would really be appreciated,
>
> i'm running on Red Hat 7.2 with :
>
> Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
> gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)
>
> under ROOT version 3.04/02
>
> thanks,
>
> seb.
>
>
>
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET