Problem 184

Summary: run-time type information not enabled in WinNT compiler options
Product: Geant4 Reporter: dcasper
Component: configAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 2.0   
Hardware: PC   
OS: Windows   

Description dcasper 2000-12-29 11:30:08 CET
The default compilation options on Windows NT (Visual C++) do not include the
c++ compiler flag -GR.  Without this flag, one cannot use a dynamic_cast
construct on a G4 object pointer (fails at run-time).  dynamic_cast is quite
useful, not only for navigating a class's inheritance hierarchy but for easily
determining the type of a pointer at runtime.  We rely on it in our application
built on Geant4.

IMO, this option should be the default of the Visual C++ compiler (it is for
most others), but since it is not, it would be helpful to include it in the
defaults for building the G4 system.

I have been manually changing the WIN32-VC.gmk file to include this option, and
I have found no problems with building and running (i.e. no side-effects).
Comment 1 Gabriele Cosmo 2001-01-08 08:32:59 CET
Although dynamic-casting is not allowed in the G4 kernel code,
I introduced -GR option for WIN32-VC. The tag "config-V03-00-00"
will be submitted to test and possible size/performance penalties
evaluated.
Comment 2 Gabriele Cosmo 2001-01-08 08:35:59 CET
Tag "config-V03-00-00" submitted to test.