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

Article translations Article translations
Article ID: 311065 - View products that this article applies to.
This article was previously published under Q311065
Expand all | Collapse all

On This Page

SUMMARY

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

How to Set Compiler Options

  1. Open your project in Visual C++ .NET or Visual C++ 2005.
  2. 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.
  3. 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:

    1. Click No in the drop-down list for the Enable C++ Exceptions option.
    2. Select the Command Line category in the C/C++ folder, and then type /EHs in the Additional Options text box.
    3. 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 (Project Directory\Debug\project name.plg). A hyperlink to this file appears in the Output window when you build the project.

REFERENCES

See the Help topic Setting Compiler Options. To find it, type the topic name in the Search tool and limit the search to Titles Only.

Properties

Article ID: 311065 - Last Review: December 31, 2005 - Revision: 2.0
APPLIES TO
  • Microsoft Visual C++ 2005 Express Edition
  • Microsoft Visual C++ .NET 2002 Standard Edition
Keywords: 
kbhowtomaster KB311065

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com