Export (0) Print
Expand All
Expand Minimize

/GR (Enable Run-Time Type Information)

Updated: September 2008

Adds code to check object types at run time.

/GR[-]

When /GR is on, the compiler defines the _CPPRTTI preprocessor macro. By default, /GR is on in Visual C++ 2005. /GR- disables run-time type information.

Use /GR if the compiler cannot statically resolve an object type in your code. You usually need the /GR option when your code uses dynamic_cast Operator or typeid. However, /GR increases the size of the .rdata sections of your image. If your code does not use dynamic_cast or typeid, /GR- may produce a smaller image.

For more information about 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 How to: Open Project Property Pages.

  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

Date

History

Reason

September 2008

Specified when an application needs this compiler option.

Content bug fix.

Community Additions

ADD
Show:
© 2014 Microsoft