How to modify default compiler options for the Visual C++ compiler (311065)



The information in this article applies to:

  • Microsoft Visual C++ 2005 Express Edition
  • Microsoft Visual C++ .NET (2002)

This article was previously published under Q311065

SUMMARY

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

back to the top

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.
back to the top

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.

back to the top

Modification Type:MajorLast Reviewed:12/31/2005
Keywords:kbHOWTOmaster KB311065 kbAudDeveloper