Export (0) Print
Expand All
Expand Minimize
4 out of 4 rated this helpful - Rate this topic

/GR (Enable Run-Time Type Information)

Adds code to check object types at run time.


/GR[-]

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 dynamic_cast Operator or 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.

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 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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.