Visual-C++-2017 二进制文件是否与 VC++-2015 兼容?

Is Visual-C++-2017 binary compatible with VC++-2015?

Steve tells me VC 2015 和 VC 2017 实际上(将会)二进制兼容.

我发现 信息 wrt。这在 release notes for 2017 (RC) - 或者几乎任何地方,所以这里是:


(*): 是的,我实际上已经安装了 2017 RC,从表面上看,至少 相同 MS[=43=使用 ]RT,即 msvcp140.dllvcruntime140.dll(尽管平台工具集被称为 "v141"。

是的,141 和 140 库几乎相同。该版本因并排问题而受到影响。 VisualC++ 2015 中的 v140 工具集和 VC++ 2017 中的 v141 工具集是二进制兼容的。

Microsoft 一直在以增量方式更新其 CRT。

Visual C++ 14.0 (2015) CRT 有 4 个文件:

  • vcruntime140.dll(C 运行时;来自重构的 msvcr*.dll)
  • concrt140.dll(并发运行时;也来自 msvcr*.dll)
  • msvcp140.dll(C++ 运行时)
  • vccorlib140.dll(C++/CX 平台::*)

Visual C++ 14.1 (2017) CRT 仅添加 2 个文件:

Visual C++ 14.2 (2019) CRT 仅添加 2 个文件:

如果不使用上面列出的某些附加功能,二进制文件可以与旧版本的 C 运行时一起使用。

是的,visual 2019(14.2),2017(14.1),2015(14.0)都是二进制兼容的,都是14.x版本。在 https://docs.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=vs-2017 上查看更多信息。 新版本增加了一些新功能或补丁。

以下是2017年和2019年的文件,您可以找到2019年新增的文件。


C:\Users\Liu.D.H>dir "C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Redist\MSVC.16.27012\x64\Microsoft.VC141.CRT"
 Volume in drive C is System
 Volume Serial Number is 0CAC-076E

 Directory of C:\Program Files (x86)\Microsoft Visual Studio17\Community\VC\Redist\MSVC.16.27012\x64\Microsoft.VC141.CRT

2020-09-25  14:41    <DIR>          .
2020-09-25  14:41    <DIR>          ..
2020-09-25  14:41           332,568 concrt140.dll
2020-09-25  14:41           627,992 msvcp140.dll
2020-09-25  14:41            31,512 msvcp140_1.dll
2020-09-25  14:41           206,104 msvcp140_2.dll
2020-09-25  14:41           366,872 vccorlib140.dll
2020-09-25  14:41            85,784 vcruntime140.dll
               6 File(s)      1,650,832 bytes
               2 Dir(s)  57,822,343,168 bytes free

C:\Users\Liu.D.H>dir "C:\Program Files (x86)\Microsoft Visual Studio19\Community\VC\Redist\MSVC.27.29016\x64\Microsoft.VC142.CRT"
 Volume in drive C is System
 Volume Serial Number is 0CAC-076E

 Directory of C:\Program Files (x86)\Microsoft Visual Studio19\Community\VC\Redist\MSVC.27.29016\x64\Microsoft.VC142.CRT

2020-09-25  13:07    <DIR>          .
2020-09-25  13:07    <DIR>          ..
2020-09-25  13:07           317,224 concrt140.dll
2020-09-25  13:07           590,632 msvcp140.dll
2020-09-25  13:07            31,528 msvcp140_1.dll
2020-09-25  13:07           193,832 msvcp140_2.dll
2020-09-25  13:07            27,936 msvcp140_codecvt_ids.dll
2020-09-25  13:07           337,696 vccorlib140.dll
2020-09-25  13:07           101,672 vcruntime140.dll
2020-09-25  13:07            44,328 vcruntime140_1.dll
               8 File(s)      1,644,848 bytes
               2 Dir(s)  57,822,343,168 bytes free

C:\Users\Liu.D.H>

因为我无法安装 2015 文件。我将其解压缩 (D:\apps\wix311-binaries\dark.exe -nologo -x "D:\tmp\vcredist_x64-2015" "C:\Users\Liu.D.H\Downloads\vc_redist.x64-2015.exe"),您可以在下面找到文件。

liudonghua@desktop-ldh:/mnt/d/tmp/vcredist_x64-2015$ /usr/bin/tree .
.
├── AttachedContainer
│   └── packages
│       ├── Patch
│       │   ├── x64
│       │   │   ├── Windows6.0-KB2999226-x64.msu
│       │   │   ├── Windows6.1-KB2999226-x64.msu
│       │   │   ├── Windows8-RT-KB2999226-x64.msu
│       │   │   └── Windows8.1-KB2999226-x64.msu
│       │   └── x86
│       │       ├── Windows6.0-KB2999226-x86.msu
│       │       ├── Windows6.1-KB2999226-x86.msu
│       │       ├── Windows8-RT-KB2999226-x86.msu
│       │       └── Windows8.1-KB2999226-x86.msu
│       ├── vcRuntimeAdditional_amd64
│       │   ├── cab1
│       │   │   ├── mfc140.dll
│       │   │   ├── mfc140chs.dll
│       │   │   ├── mfc140cht.dll
│       │   │   ├── mfc140deu.dll
│       │   │   ├── mfc140enu.dll
│       │   │   ├── mfc140esn.dll
│       │   │   ├── mfc140fra.dll
│       │   │   ├── mfc140ita.dll
│       │   │   ├── mfc140jpn.dll
│       │   │   ├── mfc140kor.dll
│       │   │   ├── mfc140rus.dll
│       │   │   ├── mfc140u.dll
│       │   │   ├── mfcm140.dll
│       │   │   └── mfcm140u.dll
│       │   ├── cab1.cab
│       │   └── vc_runtimeAdditional_x64.msi
│       └── vcRuntimeMinimum_amd64
│           ├── cab1
│           │   ├── api_ms_win_core_console_l1_1_0.dll
│           │   ├── api_ms_win_core_datetime_l1_1_0.dll
│           │   ├── api_ms_win_core_debug_l1_1_0.dll
│           │   ├── api_ms_win_core_errorhandling_l1_1_0.dll
│           │   ├── api_ms_win_core_file_l1_1_0.dll
│           │   ├── api_ms_win_core_file_l1_2_0.dll
│           │   ├── api_ms_win_core_file_l2_1_0.dll
│           │   ├── api_ms_win_core_handle_l1_1_0.dll
│           │   ├── api_ms_win_core_heap_l1_1_0.dll
│           │   ├── api_ms_win_core_interlocked_l1_1_0.dll
│           │   ├── api_ms_win_core_libraryloader_l1_1_0.dll
│           │   ├── api_ms_win_core_localization_l1_2_0.dll
│           │   ├── api_ms_win_core_memory_l1_1_0.dll
│           │   ├── api_ms_win_core_namedpipe_l1_1_0.dll
│           │   ├── api_ms_win_core_processenvironment_l1_1_0.dll
│           │   ├── api_ms_win_core_processthreads_l1_1_0.dll
│           │   ├── api_ms_win_core_processthreads_l1_1_1.dll
│           │   ├── api_ms_win_core_profile_l1_1_0.dll
│           │   ├── api_ms_win_core_rtlsupport_l1_1_0.dll
│           │   ├── api_ms_win_core_string_l1_1_0.dll
│           │   ├── api_ms_win_core_synch_l1_1_0.dll
│           │   ├── api_ms_win_core_synch_l1_2_0.dll
│           │   ├── api_ms_win_core_sysinfo_l1_1_0.dll
│           │   ├── api_ms_win_core_timezone_l1_1_0.dll
│           │   ├── api_ms_win_core_util_l1_1_0.dll
│           │   ├── api_ms_win_crt_conio_l1_1_0.dll
│           │   ├── api_ms_win_crt_convert_l1_1_0.dll
│           │   ├── api_ms_win_crt_environment_l1_1_0.dll
│           │   ├── api_ms_win_crt_filesystem_l1_1_0.dll
│           │   ├── api_ms_win_crt_heap_l1_1_0.dll
│           │   ├── api_ms_win_crt_locale_l1_1_0.dll
│           │   ├── api_ms_win_crt_math_l1_1_0.dll
│           │   ├── api_ms_win_crt_multibyte_l1_1_0.dll
│           │   ├── api_ms_win_crt_private_l1_1_0.dll
│           │   ├── api_ms_win_crt_process_l1_1_0.dll
│           │   ├── api_ms_win_crt_runtime_l1_1_0.dll
│           │   ├── api_ms_win_crt_stdio_l1_1_0.dll
│           │   ├── api_ms_win_crt_string_l1_1_0.dll
│           │   ├── api_ms_win_crt_time_l1_1_0.dll
│           │   ├── api_ms_win_crt_utility_l1_1_0.dll
│           │   ├── concrt140.dll
│           │   ├── msvcp140.dll
│           │   ├── ucrtbase.dll
│           │   ├── vcamp140.dll
│           │   ├── vccorlib140.dll
│           │   ├── vcomp140.dll
│           │   └── vcruntime140.dll
│           ├── cab1.cab
│           └── vc_runtimeMinimum_x64.msi
└── UX
    ├── 1028
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1029
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1031
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1036
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1040
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1041
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1042
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1045
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1046
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1049
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 1055
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 2052
    │   ├── license.rtf
    │   └── thm.wxl
    ├── 3082
    │   ├── license.rtf
    │   └── thm.wxl
    ├── BootstrapperApplicationData.xml
    ├── license.rtf
    ├── logo.png
    ├── manifest.xml
    ├── thm.wxl
    ├── thm.xml
    └── wixstdba.dll

23 directories, 106 files
liudonghua@desktop-ldh:/mnt/d/tmp/vcredist_x64-2015$

2015年的主要文件如下

│           │   ├── concrt140.dll
│           │   ├── msvcp140.dll
│           │   ├── ucrtbase.dll
│           │   ├── vcamp140.dll
│           │   ├── vccorlib140.dll
│           │   ├── vcomp140.dll
│           │   └── vcruntime140.dll