I noticed that header guard is missing in G4TMagFieldEquation.hh:
//
// ********************************************************************
// * License and Disclaimer *
// *
(...)
// Adapted from G4Mag_UsualEqRhs
//
// #include "G4ChargeState.hh"
#include "G4Mag_UsualEqRhs.hh"
template
<class T_Field>
class G4TMagFieldEquation : public G4Mag_UsualEqRhs
(...)
// Dependent objects
T_Field *itsField;
};
(EOF)
It causes redefinition of class template G4TMagFieldEquation
when G4TMagFieldEquation.hh
is included multiple times. This issue cannot be avoided by explicitly include only once in some case, e.g. combining multiple geant4 apps in a single executable with unity build as in my case, even if only one G4TMagFieldEquation.hh
is included in each app.
I suggest adding a header guard to resolve this issue.
Thanks,
SHZhao