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
+41-51Lines changed: 41 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,57 +18,47 @@ manager: "ghogen"
18
18
---
19
19
# CL Environment Variables
20
20
21
-
The CL tool uses the following environment variables:
22
-
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.
24
-
25
-
- INCLUDE, which must point to the \include subdirectory of your Visual C++ installation.
26
-
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.
28
-
29
-
You can set the CL or \_CL\_ environment variables using the following syntax:
30
-
31
-
```
32
-
SET CL=[ [option] ... [file] ...] [/link link-opt ...]
33
-
SET _CL_=[ [option] ... [file] ...] [/link link-opt ...]
34
-
```
35
-
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).
37
-
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).
39
-
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`.
41
-
42
-
For related information, see [Set Environment Variables](../../build/setting-the-path-and-environment-variables-for-command-line-builds.md).
43
-
44
-
## Examples
45
-
46
-
The following is an example of setting the CL environment variable:
47
-
48
-
```
49
-
SET CL=/Zp2 /Ox /I\INCLUDE\MYINCLS \LIB\BINMODE.OBJ
50
-
```
51
-
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:
59
-
60
-
```
61
-
SET CL=FILE1.C FILE2.C
62
-
SET _CL_=FILE3.OBJ
63
-
CL
64
-
```
65
-
66
-
This has the same effect as the following command line:
67
-
68
-
```
69
-
CL FILE1.C FILE2.C FILE3.OBJ
70
-
```
71
-
21
+
The CL tool uses the following environment variables:
22
+
23
+
- 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.
24
+
25
+
- INCLUDE, which must point to the \include subdirectory of your Visual C++ installation.
26
+
27
+
- 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.
28
+
29
+
You can set the CL or \_CL\_ environment variable using the following syntax:
30
+
31
+
> SET CL=[[*option*] ... [*file*] ...][/link *link-opt* ...]
32
+
> SET \_CL\_=[[*option*] ... [*file*] ...][/link *link-opt* ...]
33
+
34
+
For details on the arguments to the CL and \_CL\_ environment variables, see [Compiler Command-Line Syntax](../../build/reference/compiler-command-line-syntax.md).
35
+
36
+
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).
37
+
38
+
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`.
39
+
40
+
For related information, see [Set Environment Variables](../../build/setting-the-path-and-environment-variables-for-command-line-builds.md).
41
+
42
+
## Examples
43
+
44
+
The following is an example of setting the CL environment variable:
45
+
46
+
> SET CL=/Zp2 /Ox /I\INCLUDE\MYINCLS \LIB\BINMODE.OBJ
47
+
48
+
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:
53
+
54
+
> SET CL=FILE1.C FILE2.C
55
+
> SET \_CL\_=FILE3.OBJ
56
+
> CL
57
+
58
+
This has the same effect as the following command line:
Copy file name to clipboardExpand all lines: docs/build/reference/driver-windows-nt-kernel-mode-driver.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,8 @@ manager: "ghogen"
18
18
---
19
19
# /DRIVER (Windows NT Kernel Mode Driver)
20
20
21
-
>/DRIVER[:UPONLY |:WDM]
22
-
21
+
>/DRIVER[:UPONLY |:WDM]
22
+
23
23
## Remarks
24
24
25
25
Use the **/DRIVER** linker option to build a Windows NT kernel mode driver.
@@ -38,17 +38,17 @@ If **/DRIVER** is specified:
38
38
39
39
### To set this linker option in the Visual Studio development environment
40
40
41
-
1.Open the project's **Property Pages** dialog box. For details, see [Setting Visual C++ Project Properties](../../ide/working-with-project-properties.md).
41
+
1. Open the project's **Property Pages** dialog box. For details, see [Setting Visual C++ Project Properties](../../ide/working-with-project-properties.md).
42
42
43
-
2. Click the **Linker** folder.
43
+
1. Click the **Linker** folder.
44
44
45
-
3. Click the **System** property page.
45
+
1. Click the **System** property page.
46
46
47
-
4. Modify the **Driver** property.
47
+
1. Modify the **Driver** property.
48
48
49
49
### To set this linker option programmatically
50
50
51
-
1. See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.driver>.
51
+
- See [VCLinkerTool.driver Property](https://docs.microsoft.com/dotnet/api/microsoft.visualstudio.vcprojectengine.vclinkertool.driver?view=visualstudiosdk-2017#Microsoft_VisualStudio_VCProjectEngine_VCLinkerTool_driver).
**/FC** is also needed if you want to see the full path of a file name when using the __FILE\_\_ macro. See [Predefined Macros](../../preprocessor/predefined-macros.md) for more information on \__FILE\_\_.
47
-
48
-
The **/FC** option is implied by **/ZI**. For more information about **/ZI**, see [/Z7, /Zi, /ZI (Debug Information Format)](../../build/reference/z7-zi-zi-debug-information-format.md).
49
-
50
-
### To set this compiler option in the Visual Studio development environment
51
-
52
-
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
53
-
54
-
2. Expand the **Configuration Properties** node.
55
-
56
-
3. Expand the **C/C++** node.
57
-
58
-
4. Select the **Advanced** property page.
59
-
60
-
5. Modify the **Use Full Paths** property.
61
-
62
-
### To set this linker option programmatically
63
-
64
-
1. See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.UseFullPaths%2A>.
**/FC** is also needed if you want to see the full path of a file name when using the __FILE__ macro. See [Predefined Macros](../../preprocessor/predefined-macros.md) for more information on __FILE__.
47
+
48
+
The **/FC** option is implied by **/ZI**. For more information about **/ZI**, see [/Z7, /Zi, /ZI (Debug Information Format)](../../build/reference/z7-zi-zi-debug-information-format.md).
49
+
50
+
### To set this compiler option in the Visual Studio development environment
51
+
52
+
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
53
+
54
+
1. Expand the **Configuration Properties** node.
55
+
56
+
1. Expand the **C/C++** node.
57
+
58
+
1. Select the **Advanced** property page.
59
+
60
+
1. Modify the **Use Full Paths** property.
61
+
62
+
### To set this linker option programmatically
63
+
64
+
- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.UseFullPaths%2A>.
title: "-std (Specify Language Standard Version) | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "11/04/2016"
4
+
ms.date: "10/20/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
7
ms.tgt_pltfrm: ""
@@ -20,52 +20,50 @@ manager: "ghogen"
20
20
---
21
21
# /std (Specify Language Standard Version)
22
22
23
-
Enable supported C++ language features from the specified version of the C++ language standard.
24
-
25
-
## Syntax
26
-
27
-
```
28
-
/std:[c++14|c++17|c++latest]
29
-
```
30
-
31
-
## Remarks
32
-
33
-
The **/std** option is used to control the version-specific ISO C++ programming language standard features enabled during compilation of your code. This option allows you to disable support for certain new language and library features that may break your existing code that conforms to a particular version of the language standard. By default, **/std:c++14** is specified, which disables language and standard library features found in later versions of the C++ language standard. To explicitly enable the latest supported compiler and standard library features, use **/std:c++latest**.
34
-
35
-
The default **/std:c++14** option enables the set of C++14 features implemented by the Visual C++ compiler. This option disables compiler and standard library support for features that are changed or new in more recent versions of the language standard, with the exception of some C++17 features already implemented in previous releases of the Visual C++ compiler. To avoid breaking changes for users who have already taken dependencies on the features available as of Visual Studio 2015 Update 2, these features remain enabled when the **/std:c++14** option is specified:
36
-
37
-
-[Rules for auto with braced-init-lists](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html)
38
-
39
-
-[typename in template template-parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4051.html)
-[Attributes for namespaces and enumerators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4266.html)
44
-
45
-
-[u8 character literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4267.html)
46
-
23
+
Enable supported C++ language features from the specified version of the C++ language standard.
24
+
25
+
## Syntax
26
+
27
+
> /std:[c++14|c++17|c++latest]
28
+
29
+
## Remarks
30
+
31
+
The **/std** option is used to control the version-specific ISO C++ programming language standard features enabled during compilation of your code. This option allows you to disable support for certain new language and library features that may break your existing code that conforms to a particular version of the language standard. By default, **/std:c++14** is specified, which disables language and standard library features found in later versions of the C++ language standard. To explicitly enable the latest supported compiler and standard library features, use **/std:c++latest**.
32
+
33
+
The default **/std:c++14** option enables the set of C++14 features implemented by the Visual C++ compiler. This option disables compiler and standard library support for features that are changed or new in more recent versions of the language standard, with the exception of some C++17 features already implemented in previous releases of the Visual C++ compiler. To avoid breaking changes for users who have already taken dependencies on the features available as of Visual Studio 2015 Update 2, these features remain enabled when the **/std:c++14** option is specified:
34
+
35
+
-[Rules for auto with braced-init-lists](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html)
36
+
37
+
-[typename in template template-parameters](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4051.html)
-[Attributes for namespaces and enumerators](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4266.html)
42
+
43
+
-[u8 character literals](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4267.html)
44
+
47
45
For additional information on which C++14 and C++17 features are enabled when **/std:c++14** is specified, see the notes in [Visual C++ Language Conformance](../../visual-cpp-language-conformance.md).
48
-
49
-
The **/std:c++17** option enables the full set of C++17 features implemented by the Visual C++ compiler. This option disables compiler and standard library support for features that are changed or new in versions of the Working Draft and defect updates of the C++ Standard after C++17.
50
-
51
-
The **/std:c++latest** option enables the set of C++ language and library features implemented by Visual C++ to track the most recent Working Draft and defect updates of the C++ Standard. Use this switch to get the latest language features supported by the compiler. For a list of supported language and library features, see [What's New for Visual C++](../../what-s-new-for-visual-cpp-in-visual-studio.md). The **/std:c++latest** option does not enable features guarded by the **/experimental** switch.
52
-
53
-
The **/std** option in effect during a C++ compilation can be detected by use of the [\_MSVC\_LANG](../preprocessor/predefined-macros.md) preprocessor macro. For more information, see [Preprocessor Macros](../preprocessor/predefined-macros.md).
54
-
55
-
The **/std:c++14** and **/std:c++latest** options are available beginning in Visual C++ 2015 Update 3. The **/std:c++17** option is available beginning in Visual C++ 2017 Update Version 15.3.
56
-
57
-
[!NOTE]
58
-
> Depending on the Visual C++ compiler version or update level, certain C++14 features may not be fully implemented or fully conformant when you specify the **/std:c++14** option. For example, the Visual C++ 2017 RTM compiler does not fully support C++14-conformant `constexpr`, expression SFINAE, or 2-phase name lookup. For an overview of C++ language conformance in Visual C++, see [Visual C++ Language Conformance](../../visual-cpp-language-conformance.md).
59
-
60
-
### To set this compiler option in the Visual Studio development environment
61
-
62
-
1.Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
3.In **C++ Language Standard**, choose the language standard to support from the dropdown control, then choose **OK** or **Apply** to save your changes.
67
-
68
-
## See Also
69
-
46
+
47
+
The **/std:c++17** option enables the full set of C++17 features implemented by the Visual C++ compiler. This option disables compiler and standard library support for features that are changed or new in versions of the Working Draft and defect updates of the C++ Standard after C++17.
48
+
49
+
The **/std:c++latest** option enables the set of C++ language and library features implemented by Visual C++ to track the most recent Working Draft and defect updates of the C++ Standard. Use this switch to get the latest language features supported by the compiler. For a list of supported language and library features, see [What's New for Visual C++](../../what-s-new-for-visual-cpp-in-visual-studio.md). The **/std:c++latest** option does not enable features guarded by the **/experimental** switch.
50
+
51
+
The **/std** option in effect during a C++ compilation can be detected by use of the [\_MSVC\_LANG](../../preprocessor/predefined-macros.md) preprocessor macro. For more information, see [Preprocessor Macros](../../preprocessor/predefined-macros.md).
52
+
53
+
The **/std:c++14** and **/std:c++latest** options are available beginning in Visual C++ 2015 Update 3. The **/std:c++17** option is available beginning in Visual C++ 2017 Update Version 15.3.
54
+
55
+
>[!NOTE]
56
+
> Depending on the Visual C++ compiler version or update level, certain C++14 features may not be fully implemented or fully conformant when you specify the **/std:c++14** option. For example, the Visual C++ 2017 RTM compiler does not fully support C++14-conformant `constexpr`, expression SFINAE, or 2-phase name lookup. For an overview of C++ language conformance in Visual C++, see [Visual C++ Language Conformance](../../visual-cpp-language-conformance.md).
57
+
58
+
### To set this compiler option in the Visual Studio development environment
59
+
60
+
1. Open the project's **Property Pages** dialog box. For details, see [Working with Project Properties](../../ide/working-with-project-properties.md).
1.In **C++ Language Standard**, choose the language standard to support from the dropdown control, then choose **OK** or **Apply** to save your changes.
0 commit comments