I am trying to compile this source code:
// exception_set_unexpected.cpp // compile with: /c /EHsc #include<exception> #include<iostream> using namespace std; void unfunction( ) { cout << "I'll be back." << endl; terminate( ); } int main( ) { unexpected_handler oldHand = set_unexpected( unfunction ); unexpected( ); }
How to add compile with: /c /EHsc in Visual Studio 2010?
compile with: /c /EHsc
Right click on your project -> Properties -> Configuration Properties -> C / C ++ -> Command Prompt
Put your flags on the command line
To set this compiler option in the Visual Studio development environmentOpen the Project Page Properties dialog box. See How to open the project properties pages for more information.Click the C / C ++ folder.Go to the code generation properties page.Set Enable C ++ Exceptions for Yes (/ EHsc).Go to the command line properties page.Enter the compiler option in the Advanced Options (/ c) field.
To set this compiler option in the Visual Studio development environment
More details here .
The "/ EHsc" parameter is located in the "Code Generation" section in the project settings.
The "/ c" option, I'm not sure what it is ("keep comments" one?)?
or maybe I'm reading the original question incorrectly.
M.