|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
/GR (Enable Run-Time Type Information)
Adds code to check object types at run time.
When /GR is on, the compiler defines the _CPPRTTI preprocessor macro. In Visual C++ 2005, /GR is on by default. /GR- disables run-time type information.
Use /GR if your code uses typeid. /GR does, however, cause the .rdata sections of your image to increase in size. If your code does not use dynamic_cast or typeid, using /GR- may produce a smaller image.or
For more information on run-time type checking, seein the C++ Language Reference.
To set this compiler option in the Visual Studio development environment
Open the project's Property Pages dialog box. For details, see.
Click the C/C++ folder.
Click the Language property page.
Modify the Enable Run-Time Type Info property.
To set this compiler option programmatically