/GX (Enable Exception Handling)
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

/GX (Enable Exception Handling)

Enables synchronous exception handling with the assumption that extern C functions never throw an exception.


It is equivalent to /EH (Exception Handling Model).

/GX is in effect, by default, when you compile from within the development environment. By default, /GX- is enabled when using command-line tools.

For more information, see C++ Exception Handling.

/GX is deprecated in Visual C++ 2005; use /EH (Exception Handling Model) instead. For more information, see Deprecated Compiler Options in Visual C++ 2005.

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 Command Line property page.

  4. Type the compiler option in the Additional Options box.

To set this compiler option programmatically

© 2015 Microsoft