|
1 | 1 | ---
|
2 |
| -title: "C++ binary compatibility between Visual Studio 2015 and Visual Studio 2019" |
| 2 | +title: "C++ binary compatibility between Visual Studio 2015, 2017, and 2019" |
3 | 3 | description: "Describes how binary compatibility works between compiled C++ files in Visual Studio 2015, 2017, and 2019. One Microsoft Visual C++ Redistributable package works for all three versions."
|
4 |
| -ms.date: "11/07/2019" |
| 4 | +ms.date: "11/11/2019" |
5 | 5 | helpviewer_keywords: ["binary compatibility, Visual C++"]
|
6 | 6 | ms.assetid: 591580f6-3181-4bbe-8ac3-f4fbaca949e6
|
7 | 7 | ---
|
8 |
| -# C++ binary compatibility between Visual Studio 2015 and Visual Studio 2019 |
| 8 | +# C++ binary compatibility between Visual Studio 2015, 2017, and 2019 |
9 | 9 |
|
10 |
| -In Microsoft Visual Studio 2013 and earlier, binary compatibility isn't guaranteed between object files (OBJs), static libraries (LIBs), dynamic-link libraries (DLLs), and executables (EXEs) that were built by using different versions of the compiler toolset and runtime libraries. |
| 10 | +The Microsoft C++ (MSVC) compiler toolsets in Visual Studio 2013 and earlier don't guarantee binary compatibility across versions. You can't link object files, static libraries, dynamic libraries, and executables built by different versions. The ABIs, object formats, and runtime libraries are incompatible. |
11 | 11 |
|
12 |
| -In Visual Studio 2015 and later, the C++ toolset major number is 14 (v140 for Visual Studio 2015, v141 for Visual Studio 2017, and v142 for Visual Studio 2019). This numbering reflects the fact that both the runtime libraries and the applications compiled with any of these versions of the compiler are binary-compatible. Therefore, if you have a third-party library that was built with Visual Studio 2015, you don't have to recompile it in order to consume it from an application that was built with Visual Studio 2017 or Visual Studio 2019. |
| 12 | +We've changed this behavior in Visual Studio 2015, 2017, and 2019. The runtime libraries and apps compiled by any of these versions of the compiler are binary-compatible. It's reflected in the C++ toolset major number, which is 14 for all three versions. (The toolset version is v140 for Visual Studio 2015, v141 for 2017, and v142 for 2019). Say you have third-party libraries built by Visual Studio 2015. You can still use them in an application built by Visual Studio 2017 or 2019. There's no need to recompile with a matching toolset. The latest version of the Microsoft Visual C++ Redistributable package (the Redistributable) works for all of them. |
13 | 13 |
|
14 |
| -The only exception to this rule is that static libraries or object files that are compiled with the `/GL` compiler switch are *not* binary-compatible. |
| 14 | +There's an exception to this rule: static libraries or object files compiled using the `/GL` compiler switch *aren't* binary-compatible across versions. |
15 | 15 |
|
16 |
| -When you mix binaries built with different supported versions of the Microsoft C++ (MSVC) toolset, the Visual C++ redistributable package that your application runs on can't be older than any of the toolset versions used to build your app or any libraries it consumes. |
| 16 | +The Redistributable your app uses has an important binary-compatibility restriction. It applies when you mix binaries built with different supported versions of the toolset. The Redistributable version must be at least as new as the latest toolset used by any app component. |
17 | 17 |
|
18 | 18 | ## Upgrade the Microsoft Visual C++ Redistributable from Visual Studio 2015 or 2017 to Visual Studio 2019
|
19 | 19 |
|
20 |
| -Because we have preserved binary compatibility and kept the major version (14) the same across the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, and 2019, only one version of the Visual C++ Redistributable can be installed from those at any one time. A newer version overwrites an older version that's already installed. If you have the Visual C++ Redistributable from Visual Studio 2015 or 2017 and then later install Visual Studio 2019, the 2019 version overwrites the older version. Because we make sure that the latest version has all the newest features and bug fixes (including security fixes), we always recommend that you upgrade to the latest available version. |
| 20 | +We've kept the Microsoft Visual C++ Redistributable major version number the same for Visual Studio 2015, 2017, and 2019. That means only one instance of the Redistributable can be installed at a time. A newer version overwrites any older version that's already installed. For example, one app may install the Redistributable from Visual Studio 2015. Then, another app installs the Redistributable from Visual Studio 2019. The 2019 version overwrites the older version, but because they're binary-compatible, the earlier app still works fine. We make sure the latest version of the Redistributable has all the newest features, security updates, and bug fixes. That's why we always recommend you upgrade to the latest available version. |
21 | 21 |
|
22 |
| -Similarly, we don't let you install an older version of the Visual C++ Redistributable on a machine where a newer version is already installed. Installing the Visual C++ Redistributable from Visual Studio 2015 or 2017 on a machine that already has the 2019 version triggers an installation failure. The error resembles the following: |
| 22 | +Similarly, you can't install an older Redistributable when a newer version is already installed. The installer reports an error if you try. You'll see an error like this if you install the 2015 or 2017 Redistributable on a machine that already has the 2019 version: |
23 | 23 |
|
24 | 24 | ```Output
|
25 | 25 | 0x80070666 - Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel.
|
26 | 26 | ```
|
27 | 27 |
|
28 |
| -This error is by design. We recommend keeping the newest version installed. |
| 28 | +This error is by design. We recommend you keep the newest version installed. Make sure your installer can recover from this error silently. |
29 | 29 |
|
30 | 30 | ## See also
|
31 | 31 |
|
32 |
| -* [Visual C++ change history](../porting/visual-cpp-change-history-2003-2015.md) |
33 |
| -* [The latest supported Visual C++ Redistributable downloads](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) |
| 32 | +[Visual C++ change history](../porting/visual-cpp-change-history-2003-2015.md)\ |
| 33 | +[The latest supported Visual C++ Redistributable downloads](https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads) |
0 commit comments