| description | Learn more about: /GX (Enable Exception Handling) | ||||||
|---|---|---|---|---|---|---|---|
| title | /GX (Enable Exception Handling) | ||||||
| ms.date | 11/19/2019 | ||||||
| f1_keywords |
|
||||||
| helpviewer_keywords |
|
||||||
| ms.assetid | 933b43ba-de77-4ff8-a48b-7074de90bc1c |
Deprecated. Enables synchronous exception handling using the assumption that functions declared by using extern "C" never throw an exception.
/GX
/GX is deprecated. Use the equivalent /EHsc option instead. For a list of deprecated compiler options, see the Deprecated and Removed Compiler Options section in Compiler Options Listed by Category.
By default, /EHsc, the equivalent of /GX, is in effect when you compile by using the Visual Studio development environment. When using the command line tools, no exception handling is specified. This is the equivalent of /GX-.
-
Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.
-
Select the Configuration Properties > C/C++ > Command Line property page.
-
Enter the compiler option in the Additional Options box.
- See xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A.
MSVC Compiler Options
MSVC Compiler Command-Line Syntax
/EH (Exception Handling Model)