|
1 | 1 | ---
|
2 | 2 | description: "Learn more about Microsoft Visual C++ compiler versioning."
|
3 |
| -title: "Microsoft Visual C++ compiler versions (Visual C++)" |
| 3 | +title: "Microsoft Visual C++ compiler versioning (Visual C++)" |
4 | 4 | ms.date: 02/13/2024
|
5 | 5 | ms.service: "visual-cpp"
|
6 | 6 | ms.subservice: "tools"
|
7 | 7 | helpviewer_keywords: ["Visual C++, platforms supported", "platforms [C++]"]
|
8 | 8 | ---
|
9 |
| -# Microsoft Visual C++ compiler versions |
| 9 | +# Microsoft Visual C++ compiler versioning |
10 | 10 |
|
11 |
| -The Microsoft Visual C++ compiler version consists of a four-part major and minor version number. The compiler version is reflected in the [`_MSC_VER`](../preprocessor/predefined-macros.md) macro as a number, such as 1938. It is used to distinguish between different versions of the compiler. |
| 11 | +The Microsoft Visual C++ compiler version consists of four fields. They are reflected in various Microsoft-specific compiler macros that can be used to distinguish which version of the compiler is compiling your code. |
| 12 | + |
| 13 | +The version number consists of four fields: |
| 14 | + |
| 15 | +M - major version (2 digits)\ |
| 16 | +m - minor version (2 digits)\ |
| 17 | +B - build version (4 digits)\ |
| 18 | +R - revision version |
| 19 | + |
| 20 | +Microsoft-specific compiler macros encode these fields as follows: |
| 21 | + |
| 22 | +`_MSC_VER` = MMmm |
| 23 | +`_MSC_FULL_VER` = MMmmBBBB |
| 24 | +`_MSC_BUILD` = R |
| 25 | + |
| 26 | +For example, for Visual Studio 2022 version 17.9.0, the compiler version is 19.39.33519. The major version is 19, the minor version is 39, the build version is 33519, and the revision version is 0. In other words, `_MSC_VER` is 1939, `_MSC_FULL_VER` is 193933519, and `_MSC_BUILD` (the revision) is 0. |
| 27 | + |
| 28 | +Note: Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER` instead as described in [Service releases starting with Visual Studio 2017](#service-releases-starting-with-visual-studio-2017). The same is true for distinguishing Visual Studio 2019 16.10 and 16.11. |
| 29 | + |
| 30 | +How these fields change to distinguish between different versions of the compiler varies, as described in the following sections. |
12 | 31 |
|
13 | 32 | ## A brief history of Visual C++ compiler versioning
|
14 | 33 |
|
15 | 34 | ### Visual Studio 6.0 through Visual Studio 2015 (14.0)
|
16 | 35 |
|
17 |
| -- For major releases, `_MSC_VER` increases by 100. `_MSC_FULL_VER` increases by 10,000,000. |
| 36 | +- For major releases, `_MSC_VER` increases by 100. `_MSC_FULL_VER` increases by 10,000,000. |
18 | 37 | - For minor releases, `_MSC_VER` increases by 10. `_MSC_FULL_VER` increases by 1,000,000.
|
19 | 38 |
|
20 | 39 | Note: Visual Studio .NET 2003 was considered a minor release.
|
21 | 40 |
|
22 |
| -### Visual Studio 2017 |
| 41 | +### Visual Studio 2017 and later |
23 | 42 |
|
24 | 43 | - For major releases, the minor version increases by 10.
|
25 |
| -- Starting with Visual Studio 2017 version 15.3, the minor version increases by 1. |
| 44 | +- For minor releases, the minor version increases by 1 starting with Visual Studio 2017 version 15.3. |
26 | 45 |
|
27 | 46 | ### Service releases starting with Visual Studio 2017
|
28 | 47 |
|
29 |
| -- Distinguish servicing releases using `_MSC_FULL_VER`. The build field (the third element of the period-delimited version number) typically increases by 1. |
30 |
| -- Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER` instead. The same is true for distinguishing Visual Studio 2019 16.10 and 16.11. |
| 48 | +- Servicing releases can be distinguished using `_MSC_FULL_VER`. The build field (the BBBB in the MMmmBBBB version number) typically increases by 1. |
| 49 | + |
| 50 | +For example, two cases where `_MSC_FULL_VER` is particularly useful is to distinguish between Visual Studio 2019 16.8 and 16.9, as well as Visual Studio 2019 16.10 and 16.11. The reason is that those versions share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. |
31 | 51 |
|
32 | 52 | ## Version macros
|
33 | 53 |
|
34 |
| -- [`_MSC_VER`](../preprocessor/predefined-macros.md) distinguishes between different versions of the compiler at a high level. It's used to distinguish between major and minor releases. |
35 |
| -- [`_MSC_FULL_VER`](../preprocessor/predefined-macros.md) represents the major, minor, and build version of the compiler. It's used to distinguish between different versions of the compiler, including servicing releases. Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The same is true for Visual Studio 2019 16.10 and 16.11. |
36 |
| -- [`_MSC_BUILD`](../preprocessor/predefined-macros.md) represents the build version of the compiler. Use it to distinguish between servicing releases. |
| 54 | +Recall that the version number consists of four fields: |
| 55 | + |
| 56 | +M - major version (2 digits)\ |
| 57 | +m - minor version (2 digits)\ |
| 58 | +B - build version (4 digits)\ |
| 59 | +R - revision version |
| 60 | + |
| 61 | +- [`_MSC_VER`](../preprocessor/predefined-macros.md) distinguishes between different versions of the compiler at a high level. It's used to distinguish between major and minor releases. `_MSC_VER` = MMmm. |
| 62 | +- [`_MSC_FULL_VER`](../preprocessor/predefined-macros.md) represents the major, minor, and build version of the compiler. `_MSC_FULL_VER` = MMmmBBBB. It's used to distinguish between different versions of the compiler, including servicing releases. Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. The same is true for Visual Studio 2019 16.10 and 16.11. |
| 63 | +- [`_MSC_BUILD`](../preprocessor/predefined-macros.md) represents the build version of the compiler. `_MSC_BUILD` = R.Use it to distinguish between servicing releases. |
37 | 64 |
|
38 |
| -For example, the major version changed between Visual Studio 2013 and Visual Studio 2015, reflected by a change in `_MSC_VER` from 1800 to 1900. An example of a minor change is from 17.1 to 17.2, when `_MSC_VER` changed from 1931 to 1932. |
| 65 | +For example, the major version changed between Visual Studio 2013 and Visual Studio 2015, reflected by a change in `_MSC_VER` from 1800 to 1900. An example of a minor change is from Visual Studio 2022 17.1 to Visual Studio 2022 17.2, when `_MSC_VER` changed from 1931 to 1932. |
39 | 66 |
|
40 | 67 | The following table lists the Visual C++ compiler `_MSC_VER` for each Visual Studio release:
|
41 | 68 |
|
@@ -79,9 +106,9 @@ The following table lists the Visual C++ compiler `_MSC_VER` for each Visual Stu
|
79 | 106 | | Visual Studio 2022 version 17.9 | 1939 |
|
80 | 107 | | Visual Studio 2022 version 17.10 | 1940 |
|
81 | 108 |
|
82 |
| -<sup>a</sup> Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. `MSC_FULL_VER` for 16.8 is 192829333. `MSC_FULL_VER` for 16.9 is 192829913. |
| 109 | +<sup>a</sup> Visual Studio 2019 16.8 and 16.9 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. `_MSC_FULL_VER` for 16.8 is 192829333. `_MSC_FULL_VER` for 16.9 is 192829910. |
83 | 110 |
|
84 |
| -<sup>b</sup> Visual Studio 2019 16.10 and 16.11 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. `MSC_FULL_VER` for 16.10 is ???. `MSC_FULL_VER` for 16.11 is 192930133. |
| 111 | +<sup>b</sup> Visual Studio 2019 16.10 and 16.11 share the same major and minor versions (and `_MSC_VER`). To distinguish them, use `_MSC_FULL_VER`. `_MSC_FULL_VER` for 16.10 is 192933037. `_MSC_FULL_VER` for 16.11 is 192930133. |
85 | 112 |
|
86 | 113 | ## See also
|
87 | 114 |
|
|
0 commit comments