Message: Re: G4PrimaryParticle: Geant 4.9.5 -> Geant 4.9.6 Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: G4PrimaryParticle: Geant 4.9.5 -> Geant 4.9.6 

Forum: Event and Track Management
Re: Question G4PrimaryParticle: Geant 4.9.5 -> Geant 4.9.6 (Jean-Pascal Laedermann)
Date: 26 Jul, 2013
From: Michael H. Kelsey <Michael H. Kelsey>

On Wed, 24 Jul 2013 13:12:37 GMT, Jean-Pascal Laedermann wrote:
> Upgrading to G4.9.6 results now in an compilation error :
> 
> src/jplG4_TA.cc: In member function &#65533;virtual void
> jplTA::PreUserTrackingAction(const G4Track*)&#65533;: src/jplG4_TA.cc:25:
> error: invalid use of incomplete type &#65533;struct G4PrimaryParticle&#65533;
> 
> /usr/local/geant4.9.6-install/include/Geant4/G4DynamicParticle.hh:69:
> error: forward declaration of &#65533;struct G4PrimaryParticle&#65533;
> 
> Any idea ?

We strive, with each release, to improve the compliance of the GEANT4 code with good coding practices. This includes (in this case, for example) replacing unnecessary #include statements in .hh files with forward declarations. #includes should always be done in the .cc file where the referenced object actually gets used.

In your case, you are making use of G4PrimaryParticle in your jplG4_TA.cc file. So that file should have, up near the top,

   #include "G4PrimaryParticle.hh"

 Add Message Add Message
to: "Re: G4PrimaryParticle: Geant 4.9.5 -> Geant 4.9.6"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]