Problem 184 - run-time type information not enabled in WinNT compiler options
Summary: run-time type information not enabled in WinNT compiler options
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: config (show other problems)
Version: 2.0
Hardware: PC Windows
: P2 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2000-12-29 11:30 CET by dcasper
Modified: 2001-01-08 08:35 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.