Share via


Compiler Setup Mechanisms

You can specify compiler options on the command line, in response files, and in the CL environment variable. The compiler uses options specified on the command line exactly once; it uses options specified in a response file or with the CL environment variable every time you invoke the compiler. In addition, a response file allows you to use multiple lines of options and file names.

Compiler command options consist of either a forward slash (/) or a dash () followed by one or more letters. Certain options take arguments. In some of these options, a space is required between the option and the argument; in others, no space is allowed. The Compiler Reference gives the spacing rules for each option in the option descriptions. Except for the /HELP - List the Compiler Options option, options are case sensitive. For example, /C - Preserve Comments During Preprocessing and /c - Compile Without Linking are different options.

With the exception of the /link - Linker-Control Options option, options can appear anywhere on the compiler command line. The compiler reads options from left to right. It begins with options specified in the CL environment variable and reads the content of response files when it encounters an @filename during its left-to-right scan of the command line. After gathering all options, the compiler applies each option to all files on the command line. If the compiler encounters a conflicting option, it uses the rightmost option.

The /link option precedes all options to be passed to the linker.

See Also

About Microprocessor Compilers | About Intrinsic Functions | Supported Compilers | Compiler Options | File Name Extensions and Compiler Processing | Compiler-generated Decorated Function Names | Compiler Command Line Options | Response Files | CL Environment Variable

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.