Microsoft KB Archive/311065

= How to modify default compiler options for the Visual C++ compiler =

Article ID: 311065

Article Last Modified on 12/31/2005

-

APPLIES TO


 * Microsoft Visual C++ 2005 Express Edition
 * Microsoft Visual C++ .NET 2002 Standard Edition

-



This article was previously published under Q311065



IN THIS TASK
SUMMARY
 * How to Set Compiler Options

REFERENCES



SUMMARY
This article shows you how to change the default compiler options.

back to the top

How to Set Compiler Options
 Open your project in Visual C++ .NET or Visual C++ 2005. To display the project's Properties dialog box, either click Properties on the Project menu or right-click the project in Solution Viewer and then click Properties on the shortcut menu. Under Configuration Properties, expand the C/C++ folder. Select the category of properties that you want to change. In the right pane, click to select the option that you want to change. A drop-down list box appears when you click the option. From the list, click to select the value that you want to assign to the option.NOTE: In some cases, you may want to change the option to a value that does not appear in the list. To do this, change the value for the option to No, and then click the Command Line category in the C/C++ folder. Type the value that you want in the Additional Options text box.

As an example, consider that you want to change the value for the Enable C++ Exceptions option under Code Generation to /EHs. By default, the value for this flag is /EHsc. The only other option in the drop-down list box for Enable C++ Exceptions is No. To change the value to /EHs:

 Click No in the drop-down list for the Enable C++ Exceptions option. Select the Command Line category in the C/C++ folder, and then type /EHs in the Additional Options text box. Click Apply, and then click OK. This new value for the option will be applied when you build your application.

To confirm that your new setting has taken effect, view the build log file ( \Debug\ .plg). A hyperlink to this file appears in the Output window when you build the project.</ol> </li></ol>

back to the top

<div class="references_section">