You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The CL tool uses the following environment variables:
11
11
12
-
- CL and \_CL\_, if defined. The CL tool prepends the options and arguments defined in the CL environment variable to the commandline arguments, and appends the options and arguments defined in \_CL\_, before processing.
12
+
- CL and \_CL_, if defined. The CL tool prepends the options and arguments defined in the CL environment variable to the command-line arguments, and appends the options and arguments defined in \_CL_, before processing.
13
13
14
14
- INCLUDE, which must point to the \include subdirectory of your Visual Studio installation.
15
15
16
-
- LIBPATH, which specifies directories to search for metadata files referenced with [#using](../../preprocessor/hash-using-directive-cpp.md). See `#using` for more information on LIBPATH.
16
+
- LIBPATH, which specifies directories to search for metadata files referenced with [#using](../../preprocessor/hash-using-directive-cpp.md). For more information on LIBPATH, see [#using](../../preprocessor/hash-using-directive-cpp.md).
17
17
18
-
You can set the CL or \_CL\_ environment variable using the following syntax:
18
+
You can set the CL or \_CL_ environment variable using the following syntax:
19
19
20
-
> SET CL=[[*option*] ... [*file*] ...][/link *link-opt* ...]
20
+
> SET CL=[[*option*] ... [*file*] ...][/link *link-opt* ...]\
21
21
> SET \_CL\_=[[*option*] ... [*file*] ...][/link *link-opt* ...]
22
22
23
-
For details on the arguments to the CL and \_CL\_ environment variables, see [MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md).
23
+
For details on the arguments to the CL and \_CL_ environment variables, see [MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md).
24
24
25
25
You can use these environment variables to define the files and options you use most often and use the command line to define specific files and options for specific purposes. The CL and \_CL\_ environment variables are limited to 1024 characters (the command-line input limit).
26
26
27
-
You cannot use the /D option to define a symbol that uses an equal sign (=). You can substitute the number sign (#) for an equal sign. In this way, you can use the CL or \_CL\_ environment variables to define preprocessor constants with explicit values—for example, `/DDEBUG#1` to define `DEBUG=1`.
27
+
You can't use the [/D](d-preprocessor-definitions.md) option to define a symbol that uses an equal sign (**=**). Instead, you can use the number sign (**#**) for an equal sign. In this way, you can use the CL or \_CL_ environment variables to define preprocessor constants with explicit values—for example, `/DDEBUG#1` to define `DEBUG=1`.
28
28
29
29
For related information, see [Set Environment Variables](../setting-the-path-and-environment-variables-for-command-line-builds.md).
30
30
31
31
## Examples
32
32
33
-
The following is an example of setting the CL environment variable:
33
+
The following command is an example of setting the CL environment variable:
34
34
35
35
> SET CL=/Zp2 /Ox /I\INCLUDE\MYINCLS \LIB\BINMODE.OBJ
36
36
37
-
When this environment variable is set, if you enter `CL INPUT.C` at the command line, this is the effective command:
37
+
When the CL environment variable is set, if you enter `CL INPUT.C` at the command line, the effective command becomes:
The following example causes a plain CL command to compile the source files FILE1.c and FILE2.c, and then link the object files FILE1.obj, FILE2.obj, and FILE3.obj:
42
42
43
-
> SET CL=FILE1.C FILE2.C
44
-
> SET \_CL\_=FILE3.OBJ
43
+
> SET CL=FILE1.C FILE2.C\
44
+
> SET \_CL_=FILE3.OBJ\
45
45
> CL
46
46
47
-
This has the same effect as the following command line:
47
+
These environment variables have the same effect as the following command line:
0 commit comments