/GR (Enable Run-Time Type Information)
Collapse the table of content
Expand the table of content
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)


This option (/GR) adds code to check object types at run time. When this option is specified, the compiler defines the _CPPRTTI preprocessor macro. The option is cleared (/GR–) by default.

For more information on run-time type checking, see Run-Time Type Information in the C++ Language Reference.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
  2. Click the C/C++ folder.
  3. Click the Language property page.
  4. Modify the Enable Run-Time Type Info property.

To set this compiler option programmatically

See RuntimeTypeInfo Property.

See Also

Compiler Options | Setting Compiler Options

© 2015 Microsoft