Share via


Set Compiler Options

OverviewDetails

Options can be set either in the development environment or on the command line. (See Compiler Reference for a complete list.)

To set compiler options in the development environment

  • Click the Settings command on the Project menu.

    This opens the Project Settings dialog box, which has several tabs (especially the C/C++ tab) on which you can select options.

Setting compiler options outside the development environment

You can set compiler (CL.EXE) options:

Options specified in the CL environment variable are used every time you invoke CL. If a command file is named in the CL environment variable or on the command line, the options specified in the command file are used. Unlike either the command line or the CL environment variable, a command file allows you to use multiple lines of options and filenames.

Compiler options are processed "left to right", and when a conflict is detected, the last (right-most) option wins. The CL environment variable is processed before the command line, so in any conflicts between CL and the command line, the command line takes precedence.