diff --git a/docs/porting/binary-compat-2015-2017.md b/docs/porting/binary-compat-2015-2017.md index 86ad8957757..19797a108d1 100644 --- a/docs/porting/binary-compat-2015-2017.md +++ b/docs/porting/binary-compat-2015-2017.md @@ -1,31 +1,31 @@ --- -title: "C++ binary compatibility 2015-2022" -description: "Describes how binary compatibility works between compiled C++ files in Visual Studio 2015, 2017, 2019, and 2022. One Microsoft Visual C++ Redistributable package works for all three versions." -ms.date: 03/07/2024 +title: "C++ binary compatibility 2015-2026" +description: "Describes how binary compatibility works between compiled C++ files in Visual Studio 2015, 2017, 2019, 2022, and 2026. One Microsoft Visual C++ Redistributable package works for all these versions." +ms.date: 10/29/2025 helpviewer_keywords: ["binary compatibility, Visual C++"] --- # C++ binary compatibility between Visual Studio versions -The Microsoft C++ (MSVC) compiler toolsets in Visual Studio 2013 and earlier don't guarantee binary compatibility across major versions. You can't link object files, static libraries, dynamic libraries, and executables built by different versions of these toolsets. The ABIs, object formats, and runtime libraries are incompatible. +The Microsoft C++ (MSVC) Build Tools in Visual Studio 2013 and earlier don't guarantee binary compatibility across major versions. You can't link object files, static libraries, dynamic libraries, and executables built by different versions of these build tools. The ABIs, object formats, and runtime libraries are incompatible. -We've changed this behavior in Visual Studio 2015 and later versions. 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 starts with 14 for all versions since Visual Studio 2015. (The toolset version is v140 for Visual Studio 2015, v141 for 2017, v142 for 2019, and v143 for 2022). Say you have third-party libraries built by Visual Studio 2015. You can still use them in an application built by Visual Studio 2017, 2019, or 2022. 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. +We've changed this behavior in Visual Studio 2015 and later versions. The runtime libraries and apps compiled by any of these versions of the compiler are binary-compatible. It's reflected in the MSVC Build Tools major number, which starts with 14 for all versions since Visual Studio 2015. (The build tools version is v140 for Visual Studio 2015, v141 for 2017, v142 for 2019, and v143 for 2022). Say you have third-party libraries built by Visual Studio 2015. You can still use them in an application built by Visual Studio 2017, 2019, 2022, or 2026. There's no need to recompile with a matching version. The latest version of the Microsoft Visual C++ Redistributable package (the Redistributable) works for all of them. ## Restrictions on binary compatibility -There are three important restrictions on binary compatibility between the v140, v141, v142, and v143 toolsets and minor numbered version updates: +There are three important restrictions on binary compatibility between the v140, v141, v142, v143, and v145 build tools and minor numbered version updates: -- Binaries created with different versions of the v140, v141, v142, and v143 toolsets can be combined. The key rule is that the linker should only work with inputs built by a toolset that is the same version (or earlier) as itself. This applies to apps, import libraries, static libraries, and other files as described in [LINK input files](../build/reference/link-input-files.md). In some cases, an import library for an [implicitly linked](../build/linking-an-executable-to-a-dll.md#implicit-linking) DLL built by a later version of the toolset can be linked using an earlier version of the toolset--especially if the import library strictly uses `extern "C"` for the imports/exports. Here are some examples of what this all means: - - An app compiled with a 2017 toolset (v141, versions 15.0 to 15.9) can be linked to a static library compiled with Visual Studio 2022 version 17.8 (v143), but the linking must be done using a version 17.8 or later toolset. - - Apps and libraries built using VS 2015, 2017, 2019, or 2022 can be linked together, but the linking must be done using a version of the toolset that is as recent as, or more recent than, the most recent toolset used to build any of the binaries you pass to the linker. For example, given three binaries built with toolsets from VS 2015 version 14.3, VS 2017 version 15.9, and VS 2019 version 16.11, you can link them using any toolset version that is 16.11 or later. - - If a DLL is built with a newer toolset, the import library can sometimes be used with older toolsets if all of the exports follow the C language calling convention (`extern "C"`). However, the only officially supported case is consuming a newer windows SDK with an older toolset. -- The Redistributable your app uses has a similar binary-compatibility restriction. 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. -- Static libraries or object files compiled using the [`/GL` (Whole program optimization)](../build/reference/gl-whole-program-optimization.md) compiler switch or linked using [`/LTCG` (Link-time code generation)](../build/reference/ltcg-link-time-code-generation.md) *aren't* binary-compatible across versions, including minor version updates. All object files and libraries compiled using **`/GL`** and **`/LTCG`** must use exactly the same toolset for the compile and the final link. For example, code built by using **`/GL`** in the Visual Studio 2019 version 16.7 toolset can't be linked to code built by using **`/GL`** in the Visual Studio 2019 version 16.8 toolset. The compiler emits [Fatal error C1047](../error-messages/compiler-errors-1/fatal-error-c1047.md). +- Binaries created with different versions of the v140, v141, v142, v143, and v145 build tools can be combined. The key rule is that the linker should only work with inputs built by build tools that are the same version (or earlier) as itself. This applies to apps, import libraries, static libraries, and other files as described in [LINK input files](../build/reference/link-input-files.md). In some cases, an import library for an [implicitly linked](../build/linking-an-executable-to-a-dll.md#implicit-linking) DLL built by a later version of the build tools can be linked using an earlier version of the build tools--especially if the import library strictly uses `extern "C"` for the imports/exports. Here are some examples of what this all means: + - An app compiled with the 2017 build tools (v141, versions 15.0 to 15.9) can be linked to a static library compiled with Visual Studio 2022 version 17.8 (v143), but the linking must be done using a version 17.8 or later build tools. + - Apps and libraries built using VS 2015, 2017, 2019, 2022, and 2026 can be linked together, but the linking must be done using a version of the build tools that is as recent as, or more recent than, the most recent build tools used to build any of the binaries you pass to the linker. For example, given three binaries built with build tools from VS 2015 version 14.3, VS 2017 version 15.9, and VS 2019 version 16.11, you can link them using any build tools version that is 16.11 or later. + - If a DLL is built with newer build tools, the import library can sometimes be used with older build tools if all of the exports follow the C language calling convention (`extern "C"`). However, the only officially supported case is consuming a newer windows SDK with older build tools. +- The Redistributable your app uses has a similar binary-compatibility restriction. When you mix binaries built by different supported versions of the build tools, the Redistributable version must be at least as new as the latest build tools used by any app component. +- Static libraries or object files compiled using the [`/GL` (Whole program optimization)](../build/reference/gl-whole-program-optimization.md) compiler switch or linked using [`/LTCG` (Link-time code generation)](../build/reference/ltcg-link-time-code-generation.md) *aren't* binary-compatible across versions, including minor version updates. All object files and libraries compiled using **`/GL`** and **`/LTCG`** must use exactly the same build tools for the compile and the final link. For example, code built by using **`/GL`** in the Visual Studio 2019 version 16.7 build tools can't be linked to code built by using **`/GL`** in the Visual Studio 2019 version 16.8 build tools. The compiler emits [Fatal error C1047](../error-messages/compiler-errors-1/fatal-error-c1047.md). ## Upgrade the Microsoft Visual C++ Redistributable from Visual Studio 2015 and later -We've kept the Microsoft Visual C++ Redistributable major version number the same for Visual Studio 2015, 2017, 2019, and 2022. 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 2022. The 2022 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. +We've kept the Microsoft Visual C++ Redistributable major version number the same for Visual Studio 2015, 2017, 2019, 2022, and 2026. 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 2026. The 2026 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. -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 2017 or 2019 Redistributable on a machine that already has the 2022 version: +Similarly, you can't install an older Redistributable when a newer version is already installed. The installer reports an error if you try. For example, you'll see an error like this if you install the 2022 Redistributable on a machine that already has the 2026 version: ```Output 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. diff --git a/docs/porting/build-system-changes.md b/docs/porting/build-system-changes.md index bcd58b4a3d7..afde5d89f65 100644 --- a/docs/porting/build-system-changes.md +++ b/docs/porting/build-system-changes.md @@ -7,7 +7,7 @@ ms.assetid: e564d95f-a6cc-4d97-b57e-1a71daf66f4a --- # VCBuild vs. MSBuild: Build system changes in Visual Studio 2010 -The MSBuild system for C++ projects was introduced in Visual Studio 2010. In Visual Studio 2008 and earlier releases, the VCBuild system was used. Certain file types and concepts that depended on VCBuild either do not exist or are represented differently in MSBuild. This document discusses the differences in the current build system. To convert a Visual Studio 2008 project to MSBuild, you must use Visual Studio 2010. After the project is converted, you should use the latest version of Visual Studio to upgrade to the current IDE and compiler toolset. For more information, including how to obtain Visual Studio 2010, see [Instructions for Visual Studio 2008](use-native-multi-targeting.md#instructions-for-visual-studio-2008). +The MSBuild system for C++ projects was introduced in Visual Studio 2010. In Visual Studio 2008 and earlier releases, the VCBuild system was used. Certain file types and concepts that depended on VCBuild either do not exist or are represented differently in MSBuild. This document discusses the differences in the current build system. To convert a Visual Studio 2008 project to MSBuild, you must use Visual Studio 2010. After the project is converted, you should use the latest version of Visual Studio to upgrade to the current IDE and build tools. For more information, including how to obtain Visual Studio 2010, see [Instructions for Visual Studio 2008](use-native-multi-targeting.md#instructions-for-visual-studio-2008). The following sections summarize the changes from VCBuild to MSBuild. If your VCBuild project has custom build rules or macros that aren't recognized by MSBuild, see [Visual Studio Projects - C++](../build/creating-and-managing-visual-cpp-projects.md) to learn how to translate those instructions to the MSBuild system. The initial conversion from VCBuild to MSBuild is just an intermediate step. It isn't necessary to get the project file completely correct or to get the program to compile without errors. You are only using Visual Studio 2010 to convert the project to MSBuild format so that you get the project working in the latest version of Visual Studio. diff --git a/docs/porting/features-deprecated-in-visual-studio.md b/docs/porting/features-deprecated-in-visual-studio.md index 71383dbc034..21e2344e522 100644 --- a/docs/porting/features-deprecated-in-visual-studio.md +++ b/docs/porting/features-deprecated-in-visual-studio.md @@ -1,21 +1,51 @@ --- -description: "Learn more about: C++ features deprecated in Visual Studio" -title: "C++ features deprecated in Visual Studio" -ms.date: 04/07/2022 -helpviewer_keywords: ["Features deprecated in Visual Studio"] +description: "Learn more about: C++ features deprecated or removed from Visual Studio" +title: "C++ features deprecated or removed from Visual Studio" +ms.date: 10/29/2025 +helpviewer_keywords: ["Features deprecated or removed from Visual Studio"] --- -# C++ features deprecated in Visual Studio +# C++ features deprecated or removed from Visual Studio -This article is a non-exhaustive list of C++ features deprecated in Visual Studio 2019 and 2022. For information on breaking changes and conformance improvements for C++ in the latest version of Visual Studio, see [C++ conformance improvements in Visual Studio](../overview/cpp-conformance-improvements.md). +This article is a non-exhaustive list of C++ features deprecated or removed from Visual Studio 2019 and later. For information on breaking changes and conformance improvements for C++ in the latest version of Visual Studio, see [C++ conformance improvements in Visual Studio](../overview/cpp-conformance-improvements.md). -## Deprecated in Visual Studio 2019 +## Visual Studio 2019 -- Support for Windows XP development +### Support for Windows XP development - Visual Studio 2019 and later versions don't include current toolset support for creating code for Windows XP. Support for Windows XP development by using the v141_xp toolset that shipped in Visual Studio 2017 is still available as an optional component in the Visual Studio Installer. For information on how to install the v141_xp Windows XP platform toolset, see [Configuring programs for Windows XP](../build/configuring-programs-for-windows-xp.md). +Visual Studio 2019 and later versions don't include current build tools support for creating code for Windows XP. Support for Windows XP development by using the v141_xp build tools that shipped in Visual Studio 2017 is still available as an optional component in the Visual Studio Installer. For information on how to install the v141_xp Windows XP platform toolset, see [Configuring programs for Windows XP](../build/configuring-programs-for-windows-xp.md). -## Deprecated in Visual Studio 2022 +## Visual Studio 2022 -- Support for project upgrade from Visual C++ 6 - - Visual Studio 2022 and later versions don't support upgrades from Visual C++ 6 Workspace (*`.dsw`*) and Project (*`.dsp`*) files. Visual Studio no longer registers the *`.dsw`* and *`.dsp`* file extensions as Visual Studio file types. To upgrade a project with these extensions, first use Visual Studio 2019 to upgrade the project to modern Solution (*`.sln`*) and C++ Project (*`.vcxproj`*) files. Then use the current version of Visual Studio to upgrade the project again. +### Support for project upgrade from Visual C++ 6 + +Visual Studio 2022 and later versions don't support upgrades from Visual C++ 6 Workspace (*`.dsw`*) and Project (*`.dsp`*) files. Visual Studio no longer registers the *`.dsw`* and *`.dsp`* file extensions as Visual Studio file types. To upgrade a project with these extensions, first use Visual Studio 2019 to upgrade the project to modern Solution (*`.sln`*) and C++ Project (*`.vcxproj`*) files. Then use the current version of Visual Studio to upgrade the project again. + +## Visual Studio 2026 + +### Support for C++AMP, ARM32 toolchain, and /DEBUG:FASTLINK + +Visual Studio 2026 and later versions don't support C++AMP, the ARM32 toolchain, and /DEBUG:FASTLINK. If you're utilizing `/DEBUG:FASTLINK`, it's recommended to switch to [`/DEBUG:FULL`](/cpp/build/reference/debug-generate-debug-info) for improved debugging support. Developers needing to target ARM32 can continue using the Visual Studio 2022 v143 build tools as detailed in this [Microsoft blog post](https://devblogs.microsoft.com/cppblog/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2019/). + +### Deprecation of `/await` + +The MSVC compiler switch `/await` is being deprecated and will be removed in a future release. This switch enabled an early draft implementation of C++ coroutines using the `` header. Developers should transition to standard C++ coroutines by using the `` header available in C++20 and later. For C++14/17 projects, use `/await:strict` (which isn't being deprecated) to access the standard `` header without enabling other C++20 features. + +### Support for Windows 7, 8, and 8.1 for Microsoft C++ Build Tools + +In Visual Studio 2026, the Microsoft C++ (MSVC) Build Tools raised the minimum supported operating system requirements. With this release, the Build Tools no longer target: + +- Windows 7 / Windows Server 2008 R2 +- Windows 8 / Windows Server 2012 +- Windows 8.1 / Windows Server 2012 R2 + +To build applications using the latest C++ tools, your target platform must be **Windows 10** or **Windows Server 2016** (or later). + +These changes allow for better performance, enhanced security, and alignment with the most recent Windows platform capabilities. + +### Support for Mobile development with C++ workload + +The Mobile development with C++ workload for iOS and Android targeting in the Visual Studio installer is no longer being supported and will be removed in a future Visual Studio update. This includes new projects, building, and debugging. + +### Support for Embedded and IoT tools + +The Embedded and IoT tools component in the Visual Studio installer is no longer being supported and will be removed in a future Visual Studio update. This includes the RTOS Viewer, Serial Monitor, Peripheral Viewer, and ST Project Import. diff --git a/docs/porting/floating-point-migration-issues.md b/docs/porting/floating-point-migration-issues.md index c35a83ae9c3..6393e435c75 100644 --- a/docs/porting/floating-point-migration-issues.md +++ b/docs/porting/floating-point-migration-issues.md @@ -2,27 +2,26 @@ description: "Learn more about: Floating-point migration issues" title: "Floating-point migration issues" ms.date: "05/17/2017" -ms.assetid: 36a1b552-2f2b-4919-bc9d-c17f42434954 --- # Floating-point migration issues -Sometimes when you upgrade your projects to a newer version of Visual Studio, you may find that the results of certain floating-point operations have changed. This generally happens for one of two reasons: Code generation changes that take better advantage of the available processor, and bug fixes or changes to the algorithms used in math functions in the C runtime library (CRT). In general, the new results are correct to within the limits specified by the language standard. Read on to find out what's changed, and if it's important, how to get the same results your functions got before. +Sometimes when you upgrade your projects to a newer version of Visual Studio, you may notice changes in the results of certain floating-point operations. This generally happens for one of two reasons: Code generation changes that take better advantage of the available processor, and bug fixes or changes to the algorithms used in math functions in the C runtime library (CRT). In general, the new results are correct to within the limits specified by the language standard. Read on to find out what's changed, and if it's important, how to get the same results your functions got before. ## New math functions and Universal CRT changes -Most CRT math functions have been available in Visual Studio for years, but starting in Visual Studio 2013, all of the functions required by ISO C99 are included. These functions are implemented to balance performance with correctness. Because producing the correctly rounded result in every case may be prohibitively expensive, these functions are designed to efficiently produce a close approximation to the correctly rounded result. In most cases, the result produced is within +/-1 unit of least precision, or *ulp*, of the correctly rounded result, though there may be cases where there is greater inaccuracy. If you were using a different math library to get these functions before, implementation differences may be responsible for the change in your results. +Most CRT math functions have been available in Visual Studio for years, but starting in Visual Studio 2013, all of the functions required by ISO C99 are included. These functions are implemented to balance performance with correctness. Because producing the correctly rounded result in every case may be prohibitively expensive, these functions are designed to efficiently produce a close approximation to the correctly rounded result. In most cases, the result produced is within +/-1 unit of least precision, or *ulp*, of the correctly rounded result, though there may be cases where there's greater inaccuracy. If you used a different math library to obtain these functions earlier, implementation differences might explain the change in your results. -When the math functions were moved to the Universal CRT in Visual Studio 2015, some new algorithms were used, and several bugs in the implementation of the functions that were new in Visual Studio 2013 were fixed. These changes can lead to detectable differences in the results of floating-point calculations that use these functions. The functions that had bug issues were erf, exp2, remainder, remquo, scalbln, and scalbn, and their float and long double variants. Other changes in Visual Studio 2015 fixed issues in preserving floating point status word and exception state information in _clear87, _clearfp, fegetenv, fesetenv, and feholdexcept functions. +When the math functions were moved to the Universal CRT in Visual Studio 2015, some new algorithms were used, and several bugs in the implementation of the functions that were new in Visual Studio 2013 were fixed. These changes can lead to detectable differences in the results of floating-point calculations that use these functions. The functions that had bug issues were `erf`, `exp2`, `remainder`, `remquo`, `scalbln`, and `scalbn`, and their float and long double variants. Other changes in Visual Studio 2015 fixed issues in preserving floating point status word and exception state information in `_clear87`, `_clearfp`, `fegetenv`, `fesetenv`, and `feholdexcept` functions. ## Processor differences and compiler flags -Many of the floating point math library functions have different implementations for different CPU architectures. For example, the 32-bit x86 CRT may have a different implementation than the 64-bit x64 CRT. In addition, some of the functions may have multiple implementations for a given CPU architecture. The most efficient implementation is selected dynamically at run-time depending on the instruction sets supported by the CPU. For example, in the 32-bit x86 CRT, some functions have both an x87 implementation and an SSE2 implementation. When running on a CPU that supports SSE2, the faster SSE2 implementation is used. When running on a CPU that does not support SSE2, the slower x87 implementation is used. You may see this when migrating old code, because the default x86 compiler architecture option changed to [/arch:SSE2](../build/reference/arch-x86.md) in Visual Studio 2012. Because different implementations of the math library functions may use different CPU instructions and different algorithms to produce their results, the functions may produce different results on different platforms. In most cases, the results are within +/-1 ulp of the correctly rounded result, but the actual results may vary across CPUs. +Many of the floating point math library functions have different implementations for different CPU architectures. For example, the 32-bit x86 CRT may have a different implementation than the 64-bit x64 CRT. In addition, some of the functions may have multiple implementations for a given CPU architecture. The most efficient implementation is selected dynamically at run-time depending on the instruction sets supported by the CPU. For example, in the 32-bit x86 CRT, some functions have both an x87 implementation and an SSE2 implementation. When running on a CPU that supports SSE2, the faster SSE2 implementation is used. When running on a CPU that doesn't support SSE2, the slower x87 implementation is used. You may see this when migrating old code, because the default x86 compiler architecture option changed to [/arch:SSE2](../build/reference/arch-x86.md) in Visual Studio 2012. Because different implementations of the math library functions may use different CPU instructions and different algorithms to produce their results, the functions may produce different results on different platforms. In most cases, the results are within +/-1 ulp of the correctly rounded result, but the actual results may vary across CPUs. -Code-generation correctness improvements in different floating point modes in Visual Studio can also affect the results of floating-point operations when old code is compared to new code, even when using the same compiler flags. For example, the code generated by Visual Studio 2010 when [/fp:precise](../build/reference/fp-specify-floating-point-behavior.md) (the default) or `/fp:strict` was specified may not have propagated intermediate not-a-number (NaN) values through expressions correctly. Thus, some expressions that gave a numeric result in older compilers may now correctly produce a NaN result. You may also see differences because the code optimizations enabled for `/fp:fast` now take advantage of more processor features. These optimizations can use fewer instructions, but may impact the generated results because some previously visible intermediate operations have been removed. +Code-generation improvements in various floating-point modes can also alter floating-point results when comparing old code to new code, even with identical compiler flags. For example, the code generated by Visual Studio 2010 when [/fp:precise](../build/reference/fp-specify-floating-point-behavior.md) (the default) or `/fp:strict` was specified might not propagate intermediate not-a-number (NaN) values through expressions correctly. Thus, some expressions that gave a numeric result in older compilers may now correctly produce a NaN result. You may also see differences because the code optimizations enabled for `/fp:fast` now take advantage of more processor features. These optimizations can use fewer instructions, but may impact the generated results because some previously visible intermediate operations have been removed. ## How to get identical results -In most cases, the floating-point changes in the newest compilers and libraries result in faster or more correct behavior, or both. You may even see better processor power performance when SSE2 instructions replace x87 instructions. However, if you have code that must precisely replicate the floating point behavior of an older compiler, consider using Visual Studio native multi-targeting capabilities, and build the affected project with the older toolset. For more information, see [Use native multi-targeting in Visual Studio to build old projects](use-native-multi-targeting.md). +In most cases, the floating-point changes in the newest compilers and libraries result in faster or more correct behavior, or both. You may even see better processor power performance when SSE2 instructions replace x87 instructions. However, if you have code that must precisely replicate the floating point behavior of an older compiler, consider using Visual Studio native multi-targeting capabilities, and build the affected project with the older build tools. For more information, see [Use native multi-targeting in Visual Studio to build old projects](use-native-multi-targeting.md). ## See also diff --git a/docs/porting/ide-tools-for-upgrading-code.md b/docs/porting/ide-tools-for-upgrading-code.md index 13f9f48a5f4..f94f44ac1cb 100644 --- a/docs/porting/ide-tools-for-upgrading-code.md +++ b/docs/porting/ide-tools-for-upgrading-code.md @@ -1,14 +1,14 @@ --- title: "Visual Studio IDE tools for upgrading C++ code" description: "The C++ code editor and code analysis tools in Visual Studio help you to modernize your C++ code base." -ms.date: "11/13/2019" +ms.date: "11/06/2025" ms.topic: "concept-article" --- # Visual Studio IDE tools for upgrading C++ code Visual Studio helps you upgrade legacy C++ code with compiler options, code analysis warnings, and editor features such as Quick Fixes, Quick Info, and the enhanced scroll bar. The term "legacy code" refers to any of these categories: -- Code that was formerly allowed by the Microsoft C++ compiler (MSVC) but never conformed to the C++ standard. +- Code that was formerly allowed by the Microsoft C++ (MSVC) compiler but never conformed to the C++ standard. To upgrade older non-conforming MSVC code, turn on the [`/permissive-`](../build/reference/permissive-standards-conformance.md) compiler option. All instances of non-conforming usages are underlined with red squiggles in the code editor. The error messages in the **Error List** window include a recommendation for how to fix the error. Click on the error code to go to its help page in the documentation. If fixing all the errors at once is impractical, you can upgrade non-conforming code in stages by turning on the **`/permissive-`** option, fixing some errors, then turning the option off again. The code will compile with the new improvements, and you can go back and fix the remaining issues at a later time. See the [`/permissive-`](../build/reference/permissive-standards-conformance.md) page for examples of non-conforming MSVC code. @@ -22,19 +22,15 @@ Visual Studio helps you upgrade legacy C++ code with compiler options, code anal ## Open and convert a legacy project -If your legacy project is based on an older version of Visual Studio, you can open it in Visual Studio 2017 or Visual Studio 2019. Visual Studio automatically converts it to the current project schema with support for all the latest compiler and IDE features. +If your legacy projects are based on an older version of Visual Studio, you can still load them in a newer version and work on it there while maintaining backwards compatibility with the older version. When you are ready to permanently move to the new version of Visual Studio, you can retarget your projects. This will enable you to use the latest build tools and project features in the IDE, but you will no longer be able to load the retargeted projects in the older version of Visual Studio. -![Screenshot of the Upgrade a project dialog.](media/upgrade-dialog-v142.png "Upgrade a project") +To retarget projects to the Visual Studio 2026 format, you can use the setup assistant which appears the first time you open a solution containing older projects. You can also access it by right-clicking the solution in **Solution Explorer** and selecting **Retarget solution**. -For more information, see [Upgrade C++ projects from earlier versions of Visual Studio](upgrading-projects-from-earlier-versions-of-visual-cpp.md). - -## Search the code base +![Screenshot of the Visual Studio 2026 setup assistant showing a list of projects selected for retargeting to the latest MSVC Build Tools and v145 Platform Toolset.](media/vs-2026-setup-assistant.png "Upgrade projects") -Upgrading a code base often involves searching through multiple files. To search for anything in your code base, press **Ctrl+T** to bring up the **Go to All** search box. +The setup assistant then gives you the choice to either stay on the older version and install any missing build tools or Windows SDKs necessary to build, or retarget the projects to upgrade them. You can make retargeting selections for each project in the solution or select **Retarget all** > **Apply** to upgrade. -![Screenshot of the Go to all dialog.](media/go-to-all.png "Go to all") - -To narrow the search scope, type one of the 1-letter filters, followed by a space and then the thing you are looking for. +For more information, see [Upgrade C++ projects from earlier versions of Visual Studio](upgrading-projects-from-earlier-versions-of-visual-cpp.md). ## Error List diff --git a/docs/porting/media/upgrade-cpp.png b/docs/porting/media/upgrade-cpp.png new file mode 100644 index 00000000000..02870caa060 Binary files /dev/null and b/docs/porting/media/upgrade-cpp.png differ diff --git a/docs/porting/media/vs-2026-setup-assistant.png b/docs/porting/media/vs-2026-setup-assistant.png new file mode 100644 index 00000000000..85fe9817386 Binary files /dev/null and b/docs/porting/media/vs-2026-setup-assistant.png differ diff --git a/docs/porting/modifying-winver-and-win32-winnt.md b/docs/porting/modifying-winver-and-win32-winnt.md index 69ac9a1e52e..79fb1051490 100644 --- a/docs/porting/modifying-winver-and-win32-winnt.md +++ b/docs/porting/modifying-winver-and-win32-winnt.md @@ -8,7 +8,7 @@ ms.topic: how-to --- # Update WINVER and _WIN32_WINNT -When you use the Windows SDK, you can specify which versions of Windows your code can run on. The preprocessor macros **WINVER** and **_WIN32_WINNT** specify the minimum operating system version your code supports. Visual Studio and the Microsoft C++ compiler support targeting Windows 7 SP1 and later. Older toolsets include support for Windows XP SP2, Windows Server 2003 SP1, Vista, and Windows Server 2008. Windows 95, Windows 98, Windows ME, Windows NT, and Windows 2000 are unsupported. +When you use the Windows SDK, you can specify which versions of Windows your code can run on. The preprocessor macros **WINVER** and **_WIN32_WINNT** specify the minimum operating system version your code supports. Visual Studio and the Microsoft C++ compiler support targeting Windows 7 SP1 and later. Older build tools include support for Windows XP SP2, Windows Server 2003 SP1, Vista, and Windows Server 2008. Windows 95, Windows 98, Windows ME, Windows NT, and Windows 2000 are unsupported. When you upgrade an older project, you may need to update your **WINVER** or **_WIN32_WINNT** macros. If they're assigned values for an unsupported version of Windows, you may see compilation errors related to these macros. diff --git a/docs/porting/overview-of-potential-upgrade-issues-visual-cpp.md b/docs/porting/overview-of-potential-upgrade-issues-visual-cpp.md index fbae3e758a8..49014006de0 100644 --- a/docs/porting/overview-of-potential-upgrade-issues-visual-cpp.md +++ b/docs/porting/overview-of-potential-upgrade-issues-visual-cpp.md @@ -1,41 +1,41 @@ --- -description: "Learn more about: Overview of potential upgrade issues (Visual C++)" -title: "Overview of potential upgrade issues (Visual C++)" -ms.date: 10/22/2021 +description: "Learn more about: Overview of potential upgrade issues (Microsoft C++)" +title: "Overview of potential upgrade issues (Microsoft C++)" +ms.date: 10/29/2025 ms.assetid: 2c99a8cb-098f-4a9d-bf2c-b80fd06ace43 ms.topic: upgrade-and-migration-article --- -# Overview of potential upgrade issues (Visual C++) +# Overview of potential upgrade issues (Microsoft C++) -Over the years, the Microsoft C++ compiler has undergone many changes, along with changes in the C++ language itself, the C++ Standard Library, the C runtime (CRT), and other libraries such as MFC and ATL. As a result, when you upgrade an application from an earlier version of Visual Studio you might see compiler and linker errors and warnings in code that previously compiled cleanly. The older the original code base, the greater the potential for such errors. This overview summarizes the most common classes of issues you're likely to see, and provides links to more detailed information. +Over the years, the Microsoft C++ (MSVC) compiler has undergone many changes, along with changes in the C++ language itself, the C++ Standard Library (STL), the C runtime (CRT), and other libraries such as MFC and ATL. As a result, when you upgrade an application from an earlier version of Visual Studio you might see compiler and linker errors and warnings in code that previously compiled cleanly. The older the original code base, the greater the potential for such errors. This overview summarizes the most common classes of issues you're likely to see, and provides links to more detailed information. > [!NOTE] > In the past, we've recommended that upgrades that span several versions of Visual Studio should be performed incrementally one version at a time. We no longer recommend this approach. We've found that it's almost always simpler to upgrade to the most current version of Visual Studio no matter how old the code base. Questions or comments about the upgrade process can be sent to vcupgrade@microsoft.com. -## Library and toolset dependencies +## Library and build tools dependencies > [!NOTE] -> This section applies to applications and libraries built with Visual Studio 2013 and earlier. The toolsets used in Visual Studio 2015, Visual Studio 2017 and Visual Studio 2019 are binary compatible. For more information, see [C++ Binary Compatibility between Visual Studio versions](binary-compat-2015-2017.md). +> This section applies to applications and libraries built with Visual Studio 2013 and earlier. The build tools used in Visual Studio 2015, Visual Studio 2017 and Visual Studio 2019 are binary compatible. For more information, see [C++ Binary Compatibility between Visual Studio versions](binary-compat-2015-2017.md). When you upgrade an app from Visual Studio 2013 or before to a newer version, it's often both advisable and necessary to upgrade all libraries and DLLs the app links to. Either you must have access to the source code, or the library vendor must provide new binary files compiled with the same major version of the compiler. If one of these conditions is true, then you can skip this section, which deals with the details of binary compatibility. If neither is the case, then the libraries might not work in your upgraded app. The information in this section will help you understand whether you can continue with the upgrade. -### Toolset +### Build tools -The *`.obj`* and *`.lib`* file formats are well defined and rarely change. Sometimes additions are made to these file formats, but these additions generally don't affect the ability of newer toolsets to consume object files and libraries produced by older toolsets. The major exception is if you compile using [`/GL` (Whole Program Optimization)](../build/reference/gl-whole-program-optimization.md). If you compile using `/GL`, you can only link the resulting object file by using the same toolset that was used to produce it. So, if you produce an object file with `/GL` and use a Visual Studio 2017 (v141) compiler, you must link it using the Visual Studio 2017 (v141) linker. It's because the internal data structures within the object files aren't stable across major versions of the toolset. Newer toolsets don't understand the older data formats. +The *`.obj`* and *`.lib`* file formats are well defined and rarely change. Sometimes additions are made to these file formats, but these additions generally don't affect the ability of newer build tools to consume object files and libraries produced by older build tools. The major exception is if you compile using [`/GL` (Whole Program Optimization)](../build/reference/gl-whole-program-optimization.md). If you compile using `/GL`, you can only link the resulting object file by using the same build tools that were used to produce it. So, if you produce an object file with `/GL` and use a Visual Studio 2017 (v141) compiler, you must link it using the Visual Studio 2017 (v141) linker. It's because the internal data structures within the object files aren't stable across major versions of the build tools. Newer build tools don't understand the older data formats. -C++ doesn't have a stable application binary interface (ABI). But Visual Studio maintains a stable C++ ABI for all minor versions of a release. Visual Studio 2015 (v140), Visual Studio 2017 (v141), Visual Studio 2019 (v142), and Visual Studio 2022 (v143) toolsets vary only in their minor version. They all have the same major version number, which is 14. For more information, see [C++ Binary Compatibility between Visual Studio versions](binary-compat-2015-2017.md). +C++ doesn't have a stable application binary interface (ABI). But Visual Studio maintains a stable C++ ABI for all minor versions of a release. Visual Studio 2015 (v140), Visual Studio 2017 (v141), Visual Studio 2019 (v142), Visual Studio 2022 (v143), and Visual Studio 2026 (v145) build tools vary only in their minor version. They all have the same major version number, which is 14. For more information, see [C++ Binary Compatibility between Visual Studio versions](binary-compat-2015-2017.md). -If you have an object file that has external symbols with C++ linkage, that object file may not link correctly with object files produced by a different major version of the toolset. There are many possible outcomes: the link might fail entirely (for example, if name decoration changed). The link could succeed, but the app could fail at runtime (for example, if type layouts changed). Or your app might continue to work and nothing will go wrong. Also note, while the C++ ABI isn't stable, the C ABI and the subset of the C++ ABI required for COM are stable. +If you have an object file that has external symbols with C++ linkage, that object file may not link correctly with object files produced by a different major version of the build tools. There are many possible outcomes: the link might fail entirely (for example, if name decoration changed). The link could succeed, but the app could fail at runtime (for example, if type layouts changed). Or your app might continue to work and nothing will go wrong. Also note, while the C++ ABI isn't stable, the C ABI and the subset of the C++ ABI required for COM are stable. -If you link to an import library, any later version of the Visual Studio redistributable libraries that preserve ABI compatibility may be used at runtime. For example, if you compile and link your app by using the Visual Studio 2015 Update 3 toolset, you can use any later redistributable. That's because the 2015, 2017, 2019, and 2022 libraries have preserved backward binary compatibility. The reverse isn't true: You can't use a redistributable for an earlier version of the toolset than you used to build any component of your code. +If you link to an import library, any later version of the Visual Studio redistributable libraries that preserve ABI compatibility may be used at runtime. For example, if you compile and link your app by using the Visual Studio 2015 Update 3 build tools, you can use any later redistributable. That's because the 2015, 2017, 2019, 2022, and 2026 libraries have preserved backward binary compatibility. The reverse isn't true: You can't use a redistributable for an earlier version of the build tools than you used to build any component of your code. ### Libraries If you `#include` a particular version of the header files, you must link the resulting object file to the same version of the libraries. So, for example, if your source file includes the Visual Studio 2015 Update 3 ``, you must link with the Visual Studio 2015 Update 3 *`vcruntime`* library. Similarly, if your source file includes the Visual Studio 2017 version 15.5 ``, you must link with the Visual Studio 2017 version 15.5 Standard C++ library, *`msvcprt`*. Mixing-and-matching isn't supported. -For the C++ Standard Library, mixing-and-matching has been explicitly disallowed by use of `#pragma detect_mismatch` in the standard headers since Visual Studio 2010. If you try to link incompatible object files, or if you link with the wrong standard library, the link fails. +For the Microsoft C++ Standard Library (STL), mixing-and-matching has been explicitly disallowed by use of `#pragma detect_mismatch` in the standard headers since Visual Studio 2010. If you try to link incompatible object files, or if you link with the wrong standard library, the link fails. Older CRT version mixing-and-matching was never supported, but it often just worked because the API surface didn't change much over time. The Universal CRT broke backwards compatibility so that in the future we can maintain backwards compatibility. We have no plans to introduce new, versioned Universal CRT binaries in the future. Instead, the existing Universal CRT is now updated in-place. @@ -47,7 +47,7 @@ If you have a static library built by using an older version of the C Runtime he 1. If you can't (or don't want to) rebuild the static library, you may try linking with *`legacy_stdio_definitions.lib`*. If it satisfies the link-time dependencies of your static library, you'll want to thoroughly test the static library as it's used in the binary. Make sure it isn't adversely affected by any of the [behavioral changes that were made to the Universal CRT](visual-cpp-change-history-2003-2015.md#BK_CRT). -1. Perhaps your static library's dependencies aren't satisfied by *`legacy_stdio_definitions.lib`* or the library doesn't work with the Universal CRT because of behavior changes. In this case, we recommend you encapsulate your static library into a DLL that you link with the required version of the Microsoft C Runtime. For example, if the static library was built using Visual Studio 2013, build this DLL using the Visual Studio 2013 toolset and C++ libraries as well. By building the library into a DLL, you encapsulate the implementation detail that is its dependency on a particular version of the Microsoft C Runtime. Be careful the DLL interface doesn't leak details of which C Runtime it uses, for example, if it returns a `FILE*` across the DLL boundary, or a `malloc`-allocated pointer the caller must `free`. +1. Perhaps your static library's dependencies aren't satisfied by *`legacy_stdio_definitions.lib`* or the library doesn't work with the Universal CRT because of behavior changes. In this case, we recommend you encapsulate your static library into a DLL that you link with the required version of the Microsoft C Runtime. For example, if the static library was built using Visual Studio 2013, build this DLL using the Visual Studio 2013 build tools and C++ libraries as well. By building the library into a DLL, you encapsulate the implementation detail that is its dependency on a particular version of the Microsoft C Runtime. Be careful the DLL interface doesn't leak details of which C Runtime it uses, for example, if it returns a `FILE*` across the DLL boundary, or a `malloc`-allocated pointer the caller must `free`. Use of multiple CRTs in a single process isn't in and of itself problematic. (In fact, most processes load multiple CRT DLLs. For example, Windows operating system components depend on *`msvcrt.dll`*, and the CLR depends on its own private CRT.) Problems arise when you jumble state from different CRTs. For example, you shouldn't allocate memory using `msvcr110.dll!malloc` and attempt to deallocate that memory using `msvcr120.dll!free`, and you shouldn't attempt to open a FILE using `msvcr110!fopen` and attempt to read from that FILE using `msvcr120!fread`. As long as you don't jumble state from different CRTs, you can safely have multiple CRTs loaded in a single process. @@ -72,7 +72,7 @@ For unresolved symbols, you might need to fix up your project settings. - If the external is defined in a *`.lib`* file, have you specified the lib path in the project properties, and is the correct version of the *`.lib`* file located there? -- Are you attempting to link to a *`.lib`* file that was compiled with a different version of Visual Studio? If so, see the previous section on library and toolset dependencies. +- Are you attempting to link to a *`.lib`* file that was compiled with a different version of Visual Studio? If so, see the previous section on library and build tools dependencies. - Do the types of the arguments at the call site actually match an existing overload of the function? Verify the underlying types are what you expect, both for any typedefs in the function's signature and in the code that calls the function. @@ -155,7 +155,7 @@ Windows API documentation lists the minimum or maximum supported operating syste ### Windows version -When upgrading a program that uses the Windows API either directly or indirectly, you need to decide the minimum Windows version to support. In most cases, Windows 7 is a good choice. For more information, see [Header file problems](porting-guide-spy-increment.md#header_file_problems). The `WINVER` macro defines the oldest version of Windows that your program is designed to run on. If your MFC program sets `WINVER` to 0x0501 (Windows XP) you'll get a warning because MFC no longer supports XP, even if the compiler toolset itself has an XP mode. Compiler toolset support for Windows XP ended in Visual Studio 2017. +When upgrading a program that uses the Windows API either directly or indirectly, you need to decide the minimum Windows version to support. In most cases, Windows 7 is a good choice. For more information, see [Header file problems](porting-guide-spy-increment.md#header_file_problems). The `WINVER` macro defines the oldest version of Windows that your program is designed to run on. If your MFC program sets `WINVER` to 0x0501 (Windows XP) you'll get a warning because MFC no longer supports XP, even if the build tools have an XP mode. Build tools support for Windows XP ended in Visual Studio 2017, and support for Windows 7, 8.0 and 8.1 ended in Visual Studio 2026. For more information, see [Updating the target windows version](porting-guide-spy-increment.md#updating_winver) and [More outdated header files](porting-guide-spy-increment.md#outdated_header_files). @@ -171,15 +171,15 @@ This error can occur in MFC applications. It indicates an ordering issue between If your original code is compiled for 32-bit systems, you have the option of creating a 64-bit version instead of (or in addition to) a new 32-bit app. In general, you should get your program compiling in 32-bit mode first, and then attempt 64-bit. Compiling for 64-bit is straightforward, but in some cases it can reveal bugs that were hidden by 32-bit builds. -Also, you should be aware of possible compile-time and runtime issues relating to pointer size, time and size values, and size-specific format specifiers in `printf` and `scanf` functions. For more information, see [Configure Visual C++ for 64-bit, x64 targets](../build/configuring-programs-for-64-bit-visual-cpp.md) and [Common Visual C++ 64-bit migration issues](../build/common-visual-cpp-64-bit-migration-issues.md). For more migration tips, see [Programming guide for 64-bit Windows](/windows/win32/WinProg64/programming-guide-for-64-bit-windows). +Also, you should be aware of possible compile-time and runtime issues relating to pointer size, time and size values, and size-specific format specifiers in `printf` and `scanf` functions. For more information, see [Configure Microsoft C++ for 64-bit, x64 targets](../build/configuring-programs-for-64-bit-visual-cpp.md) and [Common Microsoft C++ 64-bit migration issues](../build/common-visual-cpp-64-bit-migration-issues.md). For more migration tips, see [Programming guide for 64-bit Windows](/windows/win32/WinProg64/programming-guide-for-64-bit-windows). ## Unicode vs MBCS/ASCII Before Unicode was standardized, many programs used the Multibyte Character Set (MBCS) to represent characters that weren't included in the ASCII character set. In older MFC projects, MBCS was the default setting. When you upgrade such a program, you'll see warnings that advise to use Unicode instead. If you decide the conversion to Unicode isn't worth the development cost, you may choose to disable or ignore the warning. To disable it for all projects in your solution, open **View** > **Property Manager**, select all projects for which you want to disable the warning, then right-click on the selected items and choose **Properties**. In the **Property Pages** dialog, select **Configuration Properties** > **C/C++** > **Advanced**. In the **Disable Specific Warnings** property, open the drop-down arrow, and then choose **Edit**. Enter 4996 into the text box. (Don't include the 'C' prefix.) Choose **OK** to save the property, then choose **OK** to save your changes. -For more information, see [Porting from MBCS to Unicode](porting-guide-spy-increment.md#porting_to_unicode). For general information about MBCS vs. Unicode, see [Text and Strings in Visual C++](../text/text-and-strings-in-visual-cpp.md) and [Internationalization](../c-runtime-library/internationalization.md) . +For more information, see [Porting from MBCS to Unicode](porting-guide-spy-increment.md#porting_to_unicode). For general information about MBCS vs. Unicode, see [Text and Strings in Microsoft C++](../text/text-and-strings-in-visual-cpp.md) and [Internationalization](../c-runtime-library/internationalization.md) . ## See also -[Upgrading projects from earlier versions of Visual C++](upgrading-projects-from-earlier-versions-of-visual-cpp.md)
+[Upgrading projects from earlier versions of Microsoft C++](upgrading-projects-from-earlier-versions-of-visual-cpp.md)
[C++ conformance improvements in Visual Studio](../overview/cpp-conformance-improvements.md) diff --git a/docs/porting/porting-third-party-libraries.md b/docs/porting/porting-third-party-libraries.md index 6a569a06924..d4dab9694be 100644 --- a/docs/porting/porting-third-party-libraries.md +++ b/docs/porting/porting-third-party-libraries.md @@ -1,25 +1,26 @@ --- description: "Learn more about: Porting third-party libraries" title: "Porting Third-Party Libraries" -ms.date: 10/22/2021 -helpviewer_keywords: ["3rd-party libraries", "vspkg"] +ms.date: 10/29/2025 +helpviewer_keywords: ["3rd-party libraries", "vcpkg"] ms.assetid: b055ed20-8a9e-45b2-ac2a-e3d94271c009 ms.topic: concept-article --- # Porting third-party libraries -When you upgrade a project from Visual Studio 2013 or earlier to the current version of Visual C++, you also have to upgrade any libraries that the project uses. The library and your project must be built by compatible versions and targets of the compiler toolset. If you don't have access to the library source code, and the library isn't available through vcpkg, then you must obtain an updated binary from the library vendor. For more information, see [Overview of potential upgrade issues](overview-of-potential-upgrade-issues-visual-cpp.md). +When you upgrade a project from Visual Studio 2013 or earlier to the current version of Microsoft C++ (MSVC) Build Tools, you also have to upgrade any libraries that the project uses. The library and your project must be built by compatible versions and targets of the build tools. If you don't have access to the library source code, and the library isn't available through vcpkg, then you must obtain an updated binary from the library vendor. For more information, see [Overview of potential upgrade issues](overview-of-potential-upgrade-issues-visual-cpp.md). When you upgrade an application from Visual Studio 2015 or later, it isn't necessary to upgrade dependencies because the code generated by those versions is binary-compatible. For more information, see [C++ binary compatibility between Visual Studio versions](binary-compat-2015-2017.md). ## Use vcpkg for open-source libraries -In the past, finding and upgrading third-party libraries was sometimes a non-trivial task. To make it easier to acquire and rebuild C++ third-party open-source libraries, the Visual C++ team has created a command-line tool called the **VC++ Packaging Tool** or **vcpkg**. Vcpkg has a searchable catalog of many popular C++ open-source libraries. You can install any library in the catalog directly from the vcpkg command line. When you install a library, Vcpkg creates a directory tree on your machine and adds the *`.h`* files, the *`.lib`* files, and binaries in this folder. You can use this folder in your compilation command line, or integrate it into Visual Studio 2015 or later by using the `vcpkg integrate install` command. After you integrate a library location, Visual Studio can find it and add it to any new project that you create. To use a library, just `#include` it. Visual Studio will automatically add the library path to your project settings and copy the DLL to your solution folder. For more information, see [vcpkg](/vcpkg/). +In the past, finding and upgrading third-party libraries was sometimes a non-trivial task. To make it easier to acquire and rebuild C++ third-party open-source libraries, the Microsoft C++ team has created a command-line tool called **[vcpkg](https://vcpkg.io)**. This tool has a searchable catalog (known as the curated registry) of many popular C/C++ open-source libraries. You can install any library in the catalog directly from the vcpkg command line. When you install a library, vcpkg creates a directory tree on your machine and adds the *`.h`* files, the *`.lib`* files, and binaries in this folder. You can use this folder in your compilation command line, or integrate it into Visual Studio 2015 or later by using the `vcpkg integrate install` command. After you integrate a library location, Visual Studio can find it and add it to any new project that you create. To use a library, just `#include` it. Visual Studio will automatically add the library path to your project settings and copy the DLL to your solution folder. For more information, see [vcpkg](/vcpkg/). You can either install [vcpkg from GitHub](https://github.com/microsoft/vcpkg/) or use the built-in version that ships with Visual Studio 2022 or later. To learn more about vcpkg, see the [vcpkg documentation](/vcpkg). ## Reporting issues -If your open-source library isn't found in the **vcpkg** catalog, you can open an issue on the [GitHub repo](https://github.com/Microsoft/vcpkg/issues). That's where the community and the Visual C++ team can see it and potentially create the port file for this library. +If your open-source library isn't found in the **vcpkg** curated registry, you can open an issue on the [GitHub repo](https://github.com/Microsoft/vcpkg/issues). That's where the community and the Microsoft C++ team can see it and potentially create the port file for this library. ## See also -[Visual C++ Porting and Upgrading Guide](visual-cpp-porting-and-upgrading-guide.md) +[Microsoft C++ Porting and Upgrading Guide](visual-cpp-porting-and-upgrading-guide.md) +[vcpkg Documentation](/vcpkg) diff --git a/docs/porting/porting-to-the-universal-windows-platform-cpp.md b/docs/porting/porting-to-the-universal-windows-platform-cpp.md index 742390cf472..83aeac60192 100644 --- a/docs/porting/porting-to-the-universal-windows-platform-cpp.md +++ b/docs/porting/porting-to-the-universal-windows-platform-cpp.md @@ -104,5 +104,5 @@ If you created a new UWP project using Visual Studio, you should not see this er ## See also -[Visual C++ Porting Guide](../porting/porting-to-the-universal-windows-platform-cpp.md)
+[Microsoft C++ Porting Guide](../porting/porting-to-the-universal-windows-platform-cpp.md)
[Develop apps for the Universal Windows Platform (UWP)](/visualstudio/cross-platform/develop-apps-for-the-universal-windows-platform-uwp) diff --git a/docs/porting/toc.yml b/docs/porting/toc.yml index 890de59b9b7..2594d143334 100644 --- a/docs/porting/toc.yml +++ b/docs/porting/toc.yml @@ -17,7 +17,7 @@ items: href: ../porting/floating-point-migration-issues.md - name: Use native multi-targeting in Visual Studio to build old projects href: ../porting/use-native-multi-targeting.md - - name: C++ features deprecated in Visual Studio 2019 + - name: C++ features deprecated in Visual Studio href: ../porting/features-deprecated-in-visual-studio.md - name: VCBuild vs. MSBuild href: ../porting/build-system-changes.md diff --git a/docs/porting/upgrade-your-code-to-the-universal-crt.md b/docs/porting/upgrade-your-code-to-the-universal-crt.md index 5c3ba784e29..bebc69a3fac 100644 --- a/docs/porting/upgrade-your-code-to-the-universal-crt.md +++ b/docs/porting/upgrade-your-code-to-the-universal-crt.md @@ -1,7 +1,7 @@ --- description: "Learn more about: Upgrade your code to the Universal CRT" title: "Upgrade your code to the Universal CRT" -ms.date: 06/28/2022 +ms.date: 10/29/2025 ms.assetid: eaf34c1b-da98-4058-a059-a10db693a5ce ms.topic: upgrade-and-migration-article --- @@ -9,7 +9,7 @@ ms.topic: upgrade-and-migration-article The Microsoft C Runtime Library (CRT) was refactored in Visual Studio 2015. The Standard C Library, POSIX extensions and Microsoft-specific functions, macros, and global variables were moved into a new library, the Universal C Runtime Library (Universal CRT or UCRT). The compiler-specific components of the CRT were moved into a new vcruntime library. -The UCRT is now a Windows component, and ships as part of Windows 10 and later. The UCRT supports a stable ABI based on C calling conventions, and it conforms closely to the ISO C99 standard, with only a few exceptions. It's no longer tied to a specific version of the compiler. You can use the UCRT on any version of Windows supported by Visual Studio 2015 or Visual Studio 2017. The benefit is that you no longer need to update your builds to target a new version of the CRT with every upgrade of Visual Studio. +The UCRT is now a Windows component, and ships as part of Windows 10 and later. The UCRT supports a stable ABI based on C calling conventions, and it conforms closely to the ISO C99 standard, with only a few exceptions. It's no longer tied to a specific version of the compiler. You can use the UCRT on any version of Windows supported by Visual Studio 2015 or later. The benefit is that you no longer need to update your builds to target a new version of the CRT with every upgrade of Visual Studio. This refactoring has changed the names or locations of many CRT header files, library files, and Redistributable files, and the deployment methods required for your code. Many functions and macros in the UCRT were also added or changed to improve standards conformance. To take advantage of these changes, you must update your existing code and project build systems. @@ -25,11 +25,13 @@ The retail and debug UCRT DLLs are found in separate locations. The retail DLLs ## Where to find the standard libraries and headers -The C and C++ compiler-specific runtime support library, `vcruntime`, contains the code required to support program startup and features such as exception handling and intrinsics. The library and its header files are still found in the version-specific Microsoft Visual Studio folder in your *Program Files* or *Program files (x86)* directory. +The C and C++ compiler-specific runtime support library, `vcruntime`, contains the code required to support program startup and features such as exception handling and intrinsics. The library and its header files are still found in the version-specific Microsoft Visual Studio folder in your *Program Files* or *Program Files (x86)* directory. -In Visual Studio 2017, 2019, and 2022, the header files are found under `Microsoft Visual Studio\[year]\[edition]\VC\Tools\MSVC\[lib-version]\include`. Here, `[year]` is the version of Visual Studio, `[edition]` is the edition or nickname for Visual Studio, and `[lib-version]` is the build version of the libraries. +In Visual Studio 2017-2022, the header files are found under `Microsoft Visual Studio\[year]\[edition]\VC\Tools\MSVC\[lib-version]\include`. Here, `[year]` is the version of Visual Studio, `[edition]` is the edition or nickname for Visual Studio, and `[lib-version]` is the build version of the libraries. -The link libraries are found under `Microsoft Visual Studio\[year]\[edition]\VC\Tools\MSVC\[lib-version]\lib\[architecture]`, where `[year]` is the version of Visual Studio, `[edition]` is the edition or nickname for Visual Studio, `[lib-version]` is the build version of the libraries, and `[architecture]` is the target processor architecture. Link libraries for OneCore and Store are also found in the libraries folder. +In Visual Studio 2026, the header files are found under `Microsoft Visual Studio\[version]\[channel]\VC\Tools\MSVC\[lib-version]\include`. Here, `[version]` is the major version number, `[channel]` is Insiders or Stable (depending on your Visual Studio build), and `[lib-version]` is the build version of the libraries. + +The link libraries are found under `Microsoft Visual Studio\[version]\[edition]\VC\Tools\MSVC\[lib-version]\lib\[architecture]`, where `[version]` is the year (Visual Studio 2017 - 2022) or major version number (Visual Studio 2026 or later), `[edition]` is the edition or nickname for Visual Studio, `[lib-version]` is the build version of the libraries, and `[architecture]` is the target processor architecture. Link libraries for OneCore and Store are also found in the libraries folder. The retail and debug versions of the static library are `libvcruntime.lib` and `libvcruntimed.lib`. The dynamic link retail and debug stub libraries are `vcruntime.lib` and `vcruntimed.lib`, respectively. @@ -39,18 +41,18 @@ When you update your Visual Studio C++ projects, if you have set the project's * Because the UCRT is now a Microsoft Windows operating system component, it's included as part of the operating system in Windows 10 and later. It's available through Windows Update for older operating systems, Windows Vista through Windows 8.1. A Redistributable version is available for Windows XP. As an operating system component, UCRT updates and servicing are managed by Windows Update independently of Visual Studio and Microsoft C++ compiler versions. Because the UCRT is a Windows component, for security and ease of updates, and a smaller image size, we strongly recommend you use the Redistributable package to do central deployment of the UCRT for your app. -You can use the UCRT on any version of Windows supported by Visual Studio 2015 or later. You can redistribute it using a `vcredist` package for supported versions of Windows before Windows 10. The `vcredist` packages include the UCRT components and automatically install them on Windows operating systems that don't have them installed by default. For more information, see [Redistributing Visual C++ Files](../windows/redistributing-visual-cpp-files.md). +You can use the UCRT on any version of Windows supported by Visual Studio 2015 or later. You can redistribute it using a `vcredist` package for supported versions of Windows before Windows 10. The `vcredist` packages include the UCRT components and automatically install them on Windows operating systems that don't have them installed by default. For more information, see [Redistributing Microsoft C++ Files](../windows/redistributing-visual-cpp-files.md). -App-local deployment of the UCRT is supported, though not recommended for both performance and security reasons. The DLLs for app-local deployment of the UCRT are included as part of the Windows SDK, under the *`redist`* subdirectory. The DLLs required include `ucrtbase.dll` and a set of **APISet forwarder** DLLs named `api-ms-win-[subset].dll`. The set of DLLs required on each operating system varies, so we recommended that you include all of the DLLs when you use app-local deployment. For more information and recommendations about app-local deployment, see [Deployment in Visual C++](../windows/deployment-in-visual-cpp.md). +App-local deployment of the UCRT is supported, though not recommended for both performance and security reasons. The DLLs for app-local deployment of the UCRT are included as part of the Windows SDK, under the *`redist`* subdirectory. The DLLs required include `ucrtbase.dll` and a set of **APISet forwarder** DLLs named `api-ms-win-[subset].dll`. The set of DLLs required on each operating system varies, so we recommended that you include all of the DLLs when you use app-local deployment. For more information and recommendations about app-local deployment, see [Deployment in Microsoft C++](../windows/deployment-in-visual-cpp.md). ## Changes to the Universal CRT functions and macros -Many functions were added or updated in the UCRT to improve ISO C99 conformance, and to address code quality and security issues. In some cases, this required breaking changes to the library. Your code that compiled cleanly when using an older version of the CRT may break when you compile it using the UCRT. If so, you must change your code to take advantage of UCRT updates and features. For a detailed listing of the breaking changes and updates to the CRT found in the Universal CRT, see the [C Runtime Library (CRT)](visual-cpp-change-history-2003-2015.md#BK_CRT) section of the Visual C++ change history. It includes a list of affected headers and functions that you can use to identify the changes needed in your code. +Many functions were added or updated in the UCRT to improve ISO C99 conformance, and to address code quality and security issues. In some cases, this required breaking changes to the library. Your code that compiled cleanly when using an older version of the CRT may break when you compile it using the UCRT. If so, you must change your code to take advantage of UCRT updates and features. For a detailed listing of the breaking changes and updates to the CRT found in the Universal CRT, see the [C Runtime Library (CRT)](visual-cpp-change-history-2003-2015.md#BK_CRT) section of the Microsoft C++ change history. It includes a list of affected headers and functions that you can use to identify the changes needed in your code. ## See also -[Visual C++ porting and upgrading guide](visual-cpp-porting-and-upgrading-guide.md)\ -[Overview of potential upgrade issues (Visual C++)](overview-of-potential-upgrade-issues-visual-cpp.md)\ -[Upgrading projects from earlier versions of Visual C++](upgrading-projects-from-earlier-versions-of-visual-cpp.md)\ +[Microsoft C++ porting and upgrading guide](visual-cpp-porting-and-upgrading-guide.md)\ +[Overview of potential upgrade issues (Microsoft C++)](overview-of-potential-upgrade-issues-visual-cpp.md)\ +[Upgrading projects from earlier versions of Microsoft C++](upgrading-projects-from-earlier-versions-of-visual-cpp.md)\ [Visual C++ change history 2003 - 2015](visual-cpp-change-history-2003-2015.md)\ [C++ conformance improvements in Visual Studio](../overview/cpp-conformance-improvements.md) diff --git a/docs/porting/upgrading-projects-from-earlier-versions-of-visual-cpp.md b/docs/porting/upgrading-projects-from-earlier-versions-of-visual-cpp.md index 76f6dce84d9..471d6105610 100644 --- a/docs/porting/upgrading-projects-from-earlier-versions-of-visual-cpp.md +++ b/docs/porting/upgrading-projects-from-earlier-versions-of-visual-cpp.md @@ -1,21 +1,21 @@ --- title: "Upgrade C++ projects from earlier versions of Visual Studio" description: "How to upgrade Microsoft C++ projects from older versions of Visual Studio." -ms.date: 04/07/2022 +ms.date: 11/05/2025 helpviewer_keywords: ["32-bit code porting", "upgrading Visual C++ applications, 32-bit code"] ms.assetid: 18cdacaa-4742-43db-9e4c-2d9e73d8cc84 ms.topic: upgrade-and-migration-article --- # Upgrade C++ projects from earlier versions of Visual Studio -To upgrade a project created in an earlier version of Visual Studio, just open the project in the latest version of Visual Studio. Visual Studio offers to upgrade the project to the current schema. +To upgrade a project created in an earlier version of Visual Studio, open the project in the latest version of Visual Studio. If you're still using an older version of Visual Studio side-by-side, you can choose not to upgrade your projects until you're ready to maintain compatibility with both versions. -If you choose **No**, the project doesn't get upgraded. For projects created in Visual Studio 2010 and later, you can still use the project in the newer version of Visual Studio. Just set your project properties to continue to target the older toolset. If you leave the older version of Visual Studio on your computer, its toolset is available in later versions. For example, if your project must continue to run on Windows XP, you can upgrade to Visual Studio 2019. You then specify the toolset as v141_xp or earlier in your project properties. For more information, see [Use native multi-targeting in Visual Studio to build old projects](use-native-multi-targeting.md). +In Visual Studio 2026, this experience is enhanced with a setup assistant. The setup assistant offers to install missing tools using the Visual Studio installer, and to stay on an older version or retarget your projects to the latest version. You can open the setup assistant in **Solution Explorer** by right-clicking your solution and selecting **Retarget solution**. -If you choose **Yes**, then the project gets upgraded in place. It can't be converted back to the earlier version. In upgrade scenarios, that's why it's good practice to make a backup copy of the existing project and solution files. +With the setup assistant open, choose an action for each target or select **Retarget all** to set all projects at once. Then select **Apply** to complete the upgrade in place. Once your projects are retargeted, they can't be converted back to the earlier version. It's good practice to make a backup copy of the existing project and solution files before upgrading them. > [!NOTE] -> Visual Studio 2022 has deprecated support for the upgrade of project types that have *`.dsw`* or *`.dsp`* extensions. You can use an earlier version of Visual Studio, such as Visual Studio 2019, to upgrade these projects, then upgrade them in Visual Studio 2022 to use the latest tools and features of Visual Studio. +> Visual Studio 2022 and later have deprecated support for the upgrade of project types that have *`.dsw`* or *`.dsp`* extensions. You can use an earlier version of Visual Studio, such as Visual Studio 2019, to upgrade these projects, then upgrade them again in Visual Studio 2022 or later to use the latest tools and features of Visual Studio. ## Upgrade reports @@ -37,7 +37,7 @@ When you upgrade a project, you get an upgrade report. The report is also saved - Runtime errors or unexpected results because of behavior changes. -- Errors that were introduced in the tools. If you find an issue, report it to the Visual C++ team through your normal support channels or by using the [Visual Studio C++ Developer Community](https://aka.ms/feedback/report?space=62) page. +- Errors that were introduced in the tools. If you find an issue, report it to the Microsoft C++ team through your normal support channels or by using the [Visual Studio C++ Developer Community](https://aka.ms/feedback/report?space=62) page. Some upgraded projects and solutions can be built successfully without modification. However, most projects will likely require changes to both project settings and your source code. There's no single correct way to go about fixing these issues, but we recommend using a phased approach. Before you start, review [Overview of potential upgrade issues](../porting/overview-of-potential-upgrade-issues-visual-cpp.md) for more information on many kinds of common errors. @@ -72,7 +72,7 @@ For hard-to-fix errors, you can search for solutions or post a question on [Micr ## See also -[What's New for Visual C++ in Visual Studio](../overview/what-s-new-for-visual-cpp-in-visual-studio.md)\ +[What's New for Microsoft C++ in Visual Studio](../overview/what-s-new-for-visual-cpp-in-visual-studio.md)\ [Visual C++ change history 2003 - 2015](../porting/visual-cpp-change-history-2003-2015.md)\ [Nonstandard Behavior](../cpp/nonstandard-behavior.md)\ [Port data applications](../data/data-access-programming-mfc-atl.md) diff --git a/docs/porting/use-native-multi-targeting.md b/docs/porting/use-native-multi-targeting.md index 280f53a6c89..6d57a353278 100644 --- a/docs/porting/use-native-multi-targeting.md +++ b/docs/porting/use-native-multi-targeting.md @@ -1,29 +1,33 @@ --- description: "Learn more about: Use native multi-targeting in Visual Studio to build old projects" title: "Use native multi-targeting in Visual Studio to build old projects" -ms.date: 02/22/2022 +ms.date: 10/29/2025 helpviewer_keywords: ["C++ native multi-targeting", "upgrading Visual C++ applications, retargeting"] ms.assetid: b115aabe-a9dc-4525-90d3-367d97ea20c9 --- # Use native multi-targeting in Visual Studio to build old projects -Normally, we recommend that you update your projects when you install the latest version of Visual Studio. The cost of updating your projects and code is often more than offset by the benefits of the new IDE, compiler, libraries, and tools. However, we know that you may not be able to update some projects. You may have binaries that are tied to older libraries or platforms that for maintenance reasons you can't upgrade. Your code may use non-standard language constructs that would break if you moved to a more recent compiler. Your code might rely on third-party libraries compiled for a specific version of Visual C++. Or you may produce libraries for others that must target a specific older version of Visual C++. +Normally, we recommend that you update your projects when you install the latest version of Visual Studio. The cost of updating your projects and code is often more than offset by the benefits of the new IDE, compiler, libraries, and tools. However, we know that you may not be able to update some projects. You may have binaries that are tied to older libraries or platforms that for maintenance reasons you can't upgrade. Your code may use non-standard language constructs that would break if you moved to a more recent compiler. Your code might rely on third-party libraries compiled for a specific version of Microsoft C++ (MSVC). Or you may produce libraries for others that must target a specific older version of MSVC. -Fortunately, you can use Visual Studio to build projects that target older compiler toolsets and libraries. If you still have the original tools installed, you don't have to upgrade a project from as far back as Visual Studio 2010 to take advantage of new features in the IDE: +Fortunately, you can use Visual Studio to build projects that target older build tools and libraries. If you still have the original tools installed, you don't have to upgrade a project from as far back as Visual Studio 2010 to take advantage of new features in the IDE: -- New C++ refactoring capabilities and editor experimental features +- New C++ refactoring capabilities and editor features - New Diagnostics tools debugger window and Error List window - Revamped breakpoints, exceptions window and new PerfTips - New code navigation and search tools -- New C++ Quick fixes and the Productivity Power Tools extensions. +- New C++ Quick fixes You can also target Visual Studio 2008 projects, but they can't be used unchanged. For details, see the **Instructions for Visual Studio 2008** section. -The latest versions of Visual Studio support native multi-targeting and round-tripping of projects. Native multi-targeting is the ability of the latest IDE to build using toolsets installed by previous versions of Visual Studio. Round-tripping is the ability of the latest IDE to load projects created by a previous IDE version without making any changes to the project. If you install the latest version of Visual Studio side-by-side with your existing version, you can use the new version of the IDE with the compiler and tools from the existing version to build your projects. Other members of your team can continue to use the projects in the older version of Visual Studio. +The latest versions of Visual Studio support native multi-targeting and round-tripping of projects. Native multi-targeting is the ability of the latest IDE to build using build tools installed by previous versions of Visual Studio. Round-tripping is the ability of the latest IDE to load projects created by a previous IDE version without making any changes to the project. If you install the latest version of Visual Studio side-by-side with your existing version, you can use the new version of the IDE with the compiler and tools from the existing version to build your projects. Other members of your team can continue to use the projects in the older version of Visual Studio. -When you use an older toolset, you can take advantage of many of the latest IDE features, but not the latest advances in the C++ compiler, libraries and build tools. For example, you won't be able to use the new language conformance improvements, new debugging and code analysis features, or get the faster build throughput of the latest toolset. There are also some IDE features that are incompatible with older toolsets. For example, type information may be missing in the Memory Profiler, and the refactoring operation **Convert to Raw string literals** generates C++11-conformant code that won't compile when you use Visual Studio 2012 or older toolsets. +When you use an older build tools version, you can take advantage of many of the latest IDE features, but not the latest advances in the C++ compiler, libraries and build tools. For example, you won't be able to use the new language conformance improvements, new debugging and code analysis features, or get the faster build throughput of the latest build tools. There are also some IDE features that are incompatible with older build tools. For example, type information may be missing in the Memory Profiler, and the refactoring operation **Convert to Raw string literals** generates C++11-conformant code that won't compile when you use Visual Studio 2012 or older build tools. -## How to use native multi-targeting in Visual Studio +## How to use native multi-targeting in Visual Studio 2026 + +Visual Studio 2026 includes a new **Setup assistant**. You can load an existing solution, and in **Solution Explorer** select **Retarget solution** to open the assistant. You can use the assistant to install missing C++ build tools (MSVC components and Windows SDKs) compatible with the projects you are loading, including tools originally shipped with older Visual Studio versions. This allows you to continue working with your existing projects without losing compatibility with your previous Visual Studio version. Later, when you are ready to fully upgrade, you can use the assistant to retarget these projects to the newest version of the IDE. + +## How to use native multi-targeting in Visual Studio 2010-2022 Once you have installed Visual Studio side-by-side with your older version, open your existing project in the new version of Visual Studio. When the project is loaded, Visual Studio asks you whether you want to upgrade it to use the latest C++ compiler and libraries. Since you want the project to keep the older compiler and libraries, choose the **Cancel** button. @@ -44,23 +48,23 @@ First, in addition to the current version of Visual Studio, you must install Vis Next, you must update your Visual Studio 2008 solution and projects to the current version of Visual Studio. We recommend you create a backup of your projects and solution files before the upgrade. To start the upgrade process, open the solution in the current version of Visual Studio. When you get the upgrade prompt, review the information presented, and then choose **OK** to start the upgrade. If the solution has more than one project, you must update each project. The wizard creates new *`.vcxproj`* project files side-by-side with the existing *`.vcproj`* files. As long as you also have a copy of the original *`.sln`* file, the upgrade has no other effect on your existing Visual Studio 2008 projects. > [!NOTE] -> The following steps apply to multi-targeting scenarios only. If you intend to permanently upgrade the project to a later toolset, then your next step is to save the project, open it in the latest version of Visual Studio, and address the build issues that appear there. +> The following steps apply to multi-targeting scenarios only. If you intend to permanently upgrade the project to a later build tools version, then your next step is to save the project, open it in the latest version of Visual Studio, and address the build issues that appear there. When the upgrade completes, if the log report has errors or warnings for any of your projects, review them carefully. The conversion from **VCBuild** to **MSBuild** can cause issues. Make sure you understand and implement any action items listed in the report. For more information on the upgrade log report and issues that may occur when converting **VCBuild** to **MSBuild**, see the [C++ Native Multi-Targeting](https://devblogs.microsoft.com/cppblog/c-native-multi-targeting/) blog post. -When the upgrade is complete and you've fixed any issues in the log file, your solution now targets the latest toolset. As the final step, change the properties for each project in the solution to use the Visual Studio 2008 toolset. With the solution loaded in the current version of Visual Studio, for each project in the solution, open the Project **Property Pages** dialog box: Right-click on the project in **Solution Explorer** and then select **Properties**. In the **Property Pages** dialog box, change the **Configuration** drop-down value to **All Configurations**. In **Configuration Properties**, select **General**, and then change **Platform Toolset** to **Visual Studio 2008 (v90)**. +When the upgrade is complete and you've fixed any issues in the log file, your solution now targets the latest build tools. As the final step, change the properties for each project in the solution to use the Visual Studio 2008 build tools. With the solution loaded in the current version of Visual Studio, for each project in the solution, open the Project **Property Pages** dialog box: Right-click on the project in **Solution Explorer** and then select **Properties**. In the **Property Pages** dialog box, change the **Configuration** drop-down value to **All Configurations**. In **Configuration Properties**, select **General**, and then change **Platform Toolset** to **Visual Studio 2008 (v90)**. After this change, the Visual Studio 2008 compiler and libraries are used to generate project binaries when you build the solution in the current version of Visual Studio. -## Install an older Visual Studio toolset +## Install older Visual Studio build tools -You may have an old Visual Studio C++ project that you can't or don't want to upgrade. To build it, you need the platform toolset version that matches your project. To get the toolset, you can install the free Visual Studio Community or Express edition of the version you need. Every version of Visual Studio from Visual Studio 2008 on can install the compiler, tools, and libraries you need to target that version from the current Visual Studio. Search the Microsoft Download Center to find and download a particular version of Visual Studio. Make sure you choose the C++ installation options during setup. After setup completes, run that version of Visual Studio to install any updates. Also check for any Windows Update changes that might be required. This update check process may need to be repeated more than once to get every update. +You may have an old Visual Studio C++ project that you can't or don't want to upgrade. To build it, you need the build tools version that matches your project. To get the build tools, you can install the free Visual Studio Community or Express edition of the version you need. Every version of Visual Studio from Visual Studio 2008 on can install the compiler, libraries, and other build tools you need to target that version from the current Visual Studio. Search the Microsoft Download Center to find and download a particular version of Visual Studio. Make sure you choose the C++ installation options during setup. After setup completes, run that version of Visual Studio to install any updates. Also check for any Windows Update changes that might be required. This update check process may need to be repeated more than once to get every update. For the currently available downloads, see [Download older Visual Studio software](https://visualstudio.microsoft.com/vs/older-downloads/). -When these products are installed, the **Platform Toolset** property drop-down in the **Property Pages** dialog box is automatically updated to show the available toolsets. You can now use the latest version of Visual Studio to build projects that use an older version of the toolset: no conversion or upgrade required. +When these products are installed, the **MSVC Build Tools Version** property drop-down in the **Property Pages** dialog box is automatically updated to show the available build tools versions. In some cases, there may also be new choices for the **Platform Toolset** property. You can now use the latest version of Visual Studio to build projects that use an older version of the build tools: no conversion or upgrade required. ## See also -[Upgrading projects from earlier versions of Visual C++](upgrading-projects-from-earlier-versions-of-visual-cpp.md)\ +[Upgrading projects from earlier versions of Microsoft C++](upgrading-projects-from-earlier-versions-of-visual-cpp.md)\ [C++ conformance improvements in Visual Studio](../overview/cpp-conformance-improvements.md) diff --git a/docs/porting/visual-cpp-porting-and-upgrading-guide.md b/docs/porting/visual-cpp-porting-and-upgrading-guide.md index a37ba527a58..87a10484b8c 100644 --- a/docs/porting/visual-cpp-porting-and-upgrading-guide.md +++ b/docs/porting/visual-cpp-porting-and-upgrading-guide.md @@ -1,60 +1,151 @@ --- title: "Microsoft C++ porting and upgrading guide" -description: "Upgrade Microsoft C++ code to the latest version of Visual Studio." -ms.date: 09/10/2020 -ms.assetid: f5fbcc3d-aa72-41a6-ad9a-a706af2166fb +description: "Your comprehensive hub for upgrading and modernizing Microsoft C++ code to the latest version of Visual Studio. Find tools, guides, success stories, and best practices." +ms.date: 11/06/2025 ms.topic: "overview" -ms.custom: intro-overview +ms.custom: intro-hub +author: tylermsft +ms.author: twhitney --- -# Microsoft C++ porting and upgrading guide - -This article provides a guide for upgrading Microsoft C++ code to the latest version of Visual Studio. For projects created in Visual Studio 2010 through 2017, just open the project in Visual Studio 2019. You can upgrade a Visual Studio 2008 or earlier project in two steps. Use Visual Studio 2010 to convert the project to MSBuild format first. Then open the project in Visual Studio 2019. For complete instructions, see [Upgrading C++ projects from earlier versions of Visual Studio](upgrading-projects-from-earlier-versions-of-visual-cpp.md). - -The toolsets in Visual Studio 2015, Visual Studio 2017, and Visual Studio 2019 are binary-compatible. Now you can upgrade to a more recent version of the compiler without having to upgrade your library dependencies. For more information, see [C++ binary compatibility between Visual Studio versions](binary-compat-2015-2017.md). - -When upgrading projects that use open-source libraries or are meant to run on multiple platforms, we recommended migrating to a CMake-based project. For more information, see [CMake projects in Visual Studio](../build/cmake-projects-in-visual-studio.md) - -## Reasons to upgrade C++ code - -If a legacy application is running satisfactorily, in a secure environment, and isn't under active development, there might not be much incentive to upgrade it. However, consider an upgrade in these cases: Your application requires ongoing maintenance. Or, you're doing new feature development, or making performance or security improvements. An upgrade brings these benefits: - -- The same code can run faster, because we've improved compiler optimizations. - -- Modern C++ features and programming practices eliminate many common causes of bugs, and produce code that's far easier to maintain than older C-style idioms. - -- Build times are faster, because of performance improvements in the compiler and linker. -- Better standards conformance. The [/permissive-](../build/reference/permissive-standards-conformance.md) compiler option helps you identify code that doesn't conform to the current C++ standard. The [new preprocessor](../preprocessor/preprocessor-experimental-overview.md) supports code conformance, too. - -- Better run-time security, including more secure [C Runtime library](../c-runtime-library/security-features-in-the-crt.md) features. And, compiler features such as [guard checking](../build/reference/guard-enable-guard-checks.md) and address sanitizers (new in Visual Studio 2019 version 16.4). - -## Multitargeting vs. upgrading - -Perhaps upgrading your code base to a new toolset isn't an option for you. You can still use the latest Visual Studio to build and edit projects that use older toolsets and libraries. In Visual Studio 2019, you can take advantage of features such as: - -- modern static analysis tools, including the C++ Core Guidelines checkers and Clang-Tidy, to help identify potential problems in your source code. - -- automatic formatting according to your choice of modern styles can help make legacy code much more readable. - -For more information, see [Use native multi-targeting in Visual Studio to build old projects](use-native-multi-targeting.md). - -## In this section +# Microsoft C++ porting and upgrading guide -| Title | Description | -|--|--| -| [Upgrading C++ projects from earlier versions of Visual Studio](upgrading-projects-from-earlier-versions-of-visual-cpp.md) | How to upgrade your code base to the latest version of Visual Studio and the compiler. | -| [IDE tools for upgrading C++ code](ide-tools-for-upgrading-code.md) | Useful IDE features that help in the upgrade process. | -| [C++ binary compatibility between Visual Studio versions](binary-compat-2015-2017.md) | Consume v140 and later libraries as-is from v140 and later projects. | -| [Use native multi-targeting in Visual Studio to build old projects](use-native-multi-targeting.md) | Use Visual Studio with older compilers and libraries. | -| [Visual C++ change history 2003 - 2015](visual-cpp-change-history-2003-2015.md) | A list of all the changes in the Microsoft C++ libraries and build tools from Visual Studio 2003 through 2015 that might require changes in your code. | -| [Visual C++ What's New 2003 through 2015](visual-cpp-what-s-new-2003-through-2015.md) | All the "what's new" information for Microsoft C++ from Visual Studio 2003 through Visual Studio 2015. | -| [Porting and Upgrading: Examples and Case Studies](porting-and-upgrading-examples-and-case-studies.md) | For this section, we ported and upgrades several samples and applications and discussed the experiences and results. These articles give you a sense of what's involved in the porting and upgrading process. Throughout the process, we discuss tips and tricks for upgrading and show how specific errors were fixed. | -| [Porting to the Universal Windows Platform](porting-to-the-universal-windows-platform-cpp.md) | Contains information about porting app code to Windows 10 and later | -| [Introduction to Visual C++ for UNIX Users](introduction-to-visual-cpp-for-unix-users.md) | Provides information for UNIX users who are new to Visual C++ and want to become productive with it. | -| [Running Linux programs on Windows](porting-from-unix-to-win32.md) | Discusses options for migrating UNIX applications to Windows. | +**Transform your legacy C++ applications with confidence.** Whether you're upgrading from Visual Studio 2008 or modernizing to take advantage of the latest C++ features, this comprehensive guide provides everything you need for a successful upgrade journey. + +:::row::: +:::column span=""::: +:::column-end::: +:::column span="2"::: +![C++ logo with an upward arrow and abstract code on a blue background suggesting improvements from upgrading.](media/upgrade-cpp.png) +:::column-end::: +:::column span=""::: +:::column-end::: +:::row-end::: + +:::row::: +:::column span="2"::: +## 🚀 Quick start + +**Most projects upgrade seamlessly:** For projects created in Visual Studio 2010-2017, simply open them in the latest Visual Studio. For Visual Studio 2008 or earlier projects, use our [two-step upgrade process](upgrading-projects-from-earlier-versions-of-visual-cpp.md). + +**Binary compatibility:** Visual Studio 2015, 2017, 2019, 2022, and 2026 build tools are binary-compatible, so you can upgrade without rebuilding library dependencies. [Learn more](binary-compat-2015-2017.md). + +**CMake projects:** For projects using open-source libraries or targeting multiple platforms, consider migrating to CMake. [Learn more](../build/cmake-projects-in-visual-studio.md). +:::column-end::: +:::column span="2"::: +## 💡 Why upgrade? + +- **🏃‍♂️ Better Performance:** Faster execution and build times +- **🔒 Enhanced Security:** Address sanitizers and security features +- **📐 Standards Compliance:** Modern C++ features and conformance +- **🛠️ Better Tools:** Advanced debugging and analysis capabilities +:::column-end::: +:::row-end::: + +## 🎯 Choose your upgrade path + +:::row::: +:::column::: +### 📋 Assess & plan +**Evaluate your current codebase and plan your strategy** + +- [🔍 Overview of potential upgrade issues](overview-of-potential-upgrade-issues-visual-cpp.md) +- [🔗 C++ binary compatibility between versions](binary-compat-2015-2017.md) +- [📜 Visual C++ change history 2003-2015](visual-cpp-change-history-2003-2015.md) +- [⚠️ Features deprecated in Visual Studio](features-deprecated-in-visual-studio.md) +- [🎯 Use native multi-targeting for old projects](use-native-multi-targeting.md) +:::column-end::: +:::column::: +### 🔧 Upgrade & modernize +**Step-by-step guides and tools for upgrading** + +- [⬆️ Upgrade projects from earlier versions](upgrading-projects-from-earlier-versions-of-visual-cpp.md) +- [🛠️ IDE tools for upgrading C++ code](ide-tools-for-upgrading-code.md) +- [🔄 Upgrade to Universal CRT](upgrade-your-code-to-the-universal-crt.md) +- [🔧 Update WINVER and _WIN32_WINNT](modifying-winver-and-win32-winnt.md) +- [🔗 Fix dependencies on library internals](fix-your-dependencies-on-library-internals.md) +- [📊 Floating-point migration issues](floating-point-migration-issues.md) +:::column-end::: +:::row-end::: + +:::row::: +:::column::: +### 🌐 Platform migration +**Move your applications to modern platforms** + +- [📱 Port to Universal Windows Platform](porting-to-the-universal-windows-platform-cpp.md) +- [🔗 Use existing C++ code in UWP apps](how-to-use-existing-cpp-code-in-a-universal-windows-platform-app.md) +- [🐧 Visual C++ for UNIX users](introduction-to-visual-cpp-for-unix-users.md) +- [🪟 Running Linux programs on Windows](porting-from-unix-to-win32.md) +- [📦 Port third-party libraries](porting-third-party-libraries.md) +:::column-end::: +:::column::: +### ✨ Success stories & examples +**Learn from real-world upgrade experiences** + +- [📖 Examples and case studies overview](porting-and-upgrading-examples-and-case-studies.md) +- [📝 Case study: MFC Scribble upgrade](porting-guide-mfc-scribble.md) +- [🕵️ Case study: COM Spy upgrade](porting-guide-com-spy.md) +- [🔍 Case study: Spy++ upgrade](porting-guide-spy-increment.md) +- [🏗️ VCBuild vs. MSBuild migration](build-system-changes.md) +:::column-end::: +:::row-end::: + +[📚 Read more case studies](porting-and-upgrading-examples-and-case-studies.md) + +## 🛠️ Upgrade benefits + +:::row::: +:::column span="2"::: +### Performance & optimization +- **Faster execution** with improved compiler optimizations +- **Reduced build times** through compiler and linker improvements +- **Better memory usage** with modern runtime optimizations +:::column-end::: +:::column span="2"::: +### Security & reliability +- **Enhanced security** with address sanitizers and [guard checking](../build/reference/guard-enable-guard-checks.md) +- **Secure runtime libraries** with improved [CRT security features](../c-runtime-library/security-features-in-the-crt.md)) +- **Better error detection** with static analysis tools +:::column-end::: +:::row-end::: + +:::row::: +:::column span="2"::: +### Developer experience +- **Modern IDE features** with IntelliSense improvements +- **Advanced debugging** with better visualizers and diagnostics +- **Code analysis** with Core Guidelines checkers and Clang-Tidy +:::column-end::: +:::column span="2"::: +### Standards & compatibility +- **Better C++ standards conformance** with [`/permissive-`](../build/reference/permissive-standards-conformance.md) mode +- **Modern preprocessor** for improved code conformance. [Learn more](../preprocessor/preprocessor-experimental-overview.md) +- **Cross-platform support** with CMake integration +:::column-end::: +:::row-end::: + +## 🤔 Multitargeting vs. upgrading + +**Not ready for a full upgrade?** You can still use the latest Visual Studio with older build tools and libraries: + +- ✅ **Modern static analysis tools** including C++ Core Guidelines checkers and Clang-Tidy +- ✅ **Automatic code formatting** to improve legacy code readability +- ✅ **Latest IDE features** while maintaining compatibility + +[Learn about native multi-targeting →](use-native-multi-targeting.md) + +## 🚀 Ready to start? + +1. **📊 Assess your current project** with our [upgrade issues overview](overview-of-potential-upgrade-issues-visual-cpp.md) +2. **🔄 Follow our step-by-step guide** to [upgrade from earlier versions](upgrading-projects-from-earlier-versions-of-visual-cpp.md) +3. **🛠️ Use our IDE tools** to [streamline the upgrade process](ide-tools-for-upgrading-code.md) +4. **📖 Learn from others** with our [real-world case studies](porting-and-upgrading-examples-and-case-studies.md) + +**Questions?** Join the conversation in [Microsoft Learn Q&A](/answers/topics/c%2B%2B.html) or check out the [C++ Team Blog](https://devblogs.microsoft.com/cppblog/) for the latest updates. ## See also -[C++ in Visual Studio](../overview/visual-cpp-in-visual-studio.md)
-[What's New for The C++ compiler in Visual Studio](../overview/what-s-new-for-visual-cpp-in-visual-studio.md)
-[C++ conformance improvements in Visual Studio](../overview/cpp-conformance-improvements.md)
+[C++ in Visual Studio](../overview/visual-cpp-in-visual-studio.md)\ +[What's new for the C++ compiler in Visual Studio](../overview/what-s-new-for-visual-cpp-in-visual-studio.md)\ +[C++ conformance improvements in Visual Studio](../overview/cpp-conformance-improvements.md) \ No newline at end of file