
All object files and libraries compiled using /GL and /LTCG must use exactly the same toolset for the compile and the final link.
#Amc security pro code 2015 code#
Static libraries or object files compiled using the /GL (Whole program optimization) compiler switch or linked using /LTCG (Link-time code generation) aren't binary-compatible across versions, including minor version updates. When you mix binaries built by different supported versions of the toolset, the Redistributable version must be at least as new as the latest toolset used by any app component. The Redistributable your app uses has a similar binary-compatibility restriction. You can link a version 16.2 library to a version 16.4 app as long as you use a 16.4 or later toolset. You just have to link them by using a version 16.2 or later toolset. Here's an example: you can link an app compiled using any 2017 toolset (v141, versions 15.0 through 15.9) to a static library compiled using, say, Visual Studio 2019 version 16.2 (v142). However, you must link by using a toolset at least as recent as the most recent binary in your app. You can mix binaries built by different versions of the v140, v141, v142, and v143 toolsets. There are three important restrictions on binary compatibility between the v140, v141, v142, and v143 toolsets and minor numbered version updates: The latest version of the Microsoft Visual C++ Redistributable package (the Redistributable) works for all of them. There's no need to recompile with a matching toolset. You can still use them in an application built by Visual Studio 2017, 2019, or 2022. Say you have third-party libraries built by Visual Studio 2015. (The toolset version is v140 for Visual Studio 2015, v1, v1, and v1). It's reflected in the C++ toolset major number, which starts with 14 for all versions since Visual Studio 2015. The runtime libraries and apps compiled by any of these versions of the compiler are binary-compatible. We've changed this behavior in Visual Studio 2015 and later versions. The ABIs, object formats, and runtime libraries are incompatible. You can't link object files, static libraries, dynamic libraries, and executables built by different versions of these toolsets. The Microsoft C++ (MSVC) compiler toolsets in Visual Studio 2013 and earlier don't guarantee binary compatibility across major versions.
