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
Copy file name to clipboardExpand all lines: docs/build/reference/cl-environment-variables.md
+19-16Lines changed: 19 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -17,56 +17,59 @@ ms.author: "corob"
17
17
manager: "ghogen"
18
18
---
19
19
# CL Environment Variables
20
+
20
21
The CL tool uses the following environment variables:
21
22
22
-
-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.
23
+
- CL and \_CL\_, if defined. The CL tool inserts the options and arguments defined in the CL environment variable at the beginning of the command line arguments, and adds the options and arguments defined in \_CL\_ to the end of the command line arguments, before processing.
23
24
24
-
-INCLUDE, which must point to the \include subdirectory of your Visual C++ installation.
25
+
- INCLUDE, which must point to the \include subdirectory of your Visual C++ installation.
25
26
26
-
-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.
27
+
- LIBPATH, which specifies directories to search for metadata files referenced by a `#using` directive. See [#using](../../preprocessor/hash-using-directive-cpp.md) for more information on LIBPATH.
27
28
28
-
You can set the CL or _CL\_ environment variable using the following syntax:
29
+
You can set the CL or \_CL\_ environment variables using the following syntax:
29
30
30
31
```
31
32
SET CL=[ [option] ... [file] ...] [/link link-opt ...]
32
33
SET _CL_=[ [option] ... [file] ...] [/link link-opt ...]
33
34
```
34
35
35
-
For details on the arguments to the CL and _CL\_ environment variables, see [Compiler Command-Line Syntax](../../build/reference/compiler-command-line-syntax.md).
36
+
For details on the arguments to the CL and \_CL\_ environment variables, see [Compiler Command-Line Syntax](../../build/reference/compiler-command-line-syntax.md).
36
37
37
-
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).
38
+
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).
38
39
39
-
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`.
40
+
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`.
40
41
41
-
For related information, see [Set Environment Variables](../../build/setting-the-path-and-environment-variables-for-command-line-builds.md).
42
+
For related information, see [Set Environment Variables](../../build/setting-the-path-and-environment-variables-for-command-line-builds.md).
42
43
43
-
## Examples
44
-
The following is an example of setting the CL environment variable:
44
+
## Examples
45
+
46
+
The following is an example of setting the CL environment variable:
45
47
46
48
```
47
49
SET CL=/Zp2 /Ox /I\INCLUDE\MYINCLS \LIB\BINMODE.OBJ
48
50
```
49
51
50
-
When this environment variable is set, if you enter `CL INPUT.C` at the command line, this is the effective command:
52
+
When this environment variable is set, if you enter `CL INPUT.C` at the command line, this is the effective command:
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:
58
+
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:
57
59
58
60
```
59
61
SET CL=FILE1.C FILE2.C
60
62
SET _CL_=FILE3.OBJ
61
63
CL
62
64
```
63
65
64
-
This has the same effect as the following command line:
66
+
This has the same effect as the following command line:
0 commit comments