Setting Compiler Options

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

To set compiler options in the development environment

  1. On the Project menu, choose Settings.

  2. Next to Settings for, select the configuration.

  3. In the project tree, under Settings for, select the project to configure.

    You can set compiler-related options on the different tabs (especially the C/C++ tab). You can type compiler options that have no control setting under Project Options.

Setting compiler options outside the development environment

You can set compiler (CL) options:

  • on the command line
  • in command files
  • in the CL environment variable

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; when a conflict is detected, the last (right-most) option wins. The CL environment variable is processed before the command line, so the command line settings take precedence.

See Also

Building Applications on the Command Line