Skip to content

Repo sync for protected CLA branch #3506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .whatsnew.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"relativeLinkPrefix": "../"
},
"inclusionCriteria": {
"minAdditionsToFile": 3,
"minAdditionsToFile": 2,
"pullRequestTitlesToIgnore": [
"^Confirm merge from FromPublicMasterBranch",
"^Repo sync for protected CLA branch"
Expand Down
106 changes: 105 additions & 1 deletion docs/build/vscpp-step-0-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Install C and C++ support in Visual Studio
description: "Learn how to install Visual Studio with support for Microsoft C/C++ and related workloads."
ms.custom: vs-acquisition, intro-installation
ms.date: 11/05/2020
ms.date: 11/08/2021
ms.topic: "tutorial"
ms.devlang: "cpp"
ms.assetid: 45138d70-719d-42dc-90d7-1d0ca31a2f54
Expand All @@ -11,6 +11,110 @@ ms.assetid: 45138d70-719d-42dc-90d7-1d0ca31a2f54

If you haven't downloaded and installed Visual Studio and the Microsoft C/C++ tools yet, here's how to get started.

::: moniker range="msvc-170"

## Visual Studio 2022 Installation

Welcome to Visual Studio 2022! In this version, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.

> [!NOTE]
> This topic applies to installation of Visual Studio on Windows. [Visual Studio Code](https://code.visualstudio.com/) is a lightweight, cross-platform development environment that runs on Windows, Mac, and Linux systems. The Microsoft [C/C++ for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) extension supports IntelliSense, debugging, code formatting, auto-completion. Visual Studio for Mac doesn't support Microsoft C++, but does support .NET languages and cross-platform development. For installation instructions, see [Install Visual Studio for Mac](/visualstudio/mac/installation/).

Want to know more about what else is new in this version? See the Visual Studio [release notes](/visualstudio/releases/2022/release-notes/).

Ready to install? We'll walk you through it, step-by-step.

### Step 1 - Make sure your computer is ready for Visual Studio

Before you begin installing Visual Studio:

1. Check the [system requirements](/visualstudio/releases/2022/system-requirements). These requirements help you know whether your computer supports Visual Studio 2022.

1. Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.

1. Reboot. The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.

1. Free up space. Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.

For questions about running previous versions of Visual Studio side by side with Visual Studio 2022, see the [Visual Studio 2022 Platform Targeting and Compatibility](/visualstudio/releases/2022/compatibility/) page.

### Step 2 - Download Visual Studio

Next, download the Visual Studio bootstrapper file. To do so, choose the following button to go to the Visual Studio download page. Select the edition of Visual Studio that you want and choose the **Free trial** or **Free download** button.

> [!div class="button"]
> [Download Visual Studio](https://visualstudio.microsoft.com/downloads/)

### Step 3 - Install the Visual Studio installer

Run the bootstrapper file you downloaded to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.

1. From your **Downloads** folder, double-click the bootstrapper that matches or is similar to one of the following files:

- **vs_community.exe** for Visual Studio Community
- **vs_professional.exe** for Visual Studio Professional
- **vs_enterprise.exe** for Visual Studio Enterprise

If you receive a User Account Control notice, choose **Yes** to allow the bootstrapper to run.

1. We'll ask you to acknowledge the Microsoft [License Terms](https://visualstudio.microsoft.com/license-terms/) and the Microsoft [Privacy Statement](https://privacy.microsoft.com/privacystatement). Choose **Continue**.

### Step 4 - Choose workloads

After the installer is installed, you can use it to customize your installation by selecting the *workloads*, or feature sets, that you want. Here's how.

1. Find the workload you want in the **Installing Visual Studio** screen.

![Visual Studio 2022: Install a workload.](../get-started/media/vs2022-installer-workloads.png)

For core C and C++ support, choose the "Desktop development with C++" workload. It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.

Additional workloads support other kinds of development. For example, choose the "Universal Windows Platform development" workload to create apps that use the Windows Runtime for the Microsoft Store. Choose "Game development with C++" to create games that use DirectX, Unreal, and Cocos2d. Choose "Linux development with C++" to target Linux platforms, including IoT development.

The **Installation details** pane lists the included and optional components installed by each workload. You can select or deselect optional components in this list. For example, to support development by using the Visual Studio 2017 or 2015 compiler toolsets, choose the MSVC v141 or MSVC v140 optional components. You can add support for MFC, the experimental Modules language extension, IncrediBuild, and more.

1. After you choose the workload(s) and optional components you want, choose **Install**.

Next, status screens appear that show the progress of your Visual Studio installation.

> [!TIP]
> At any time after installation, you can install workloads or components that you didn't install initially. If you have Visual Studio open, go to **Tools** > **Get Tools and Features...** which opens the Visual Studio Installer. Or, open **Visual Studio Installer** from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose **Modify**.

### Step 5 - Choose individual components (Optional)

If you don't want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the **Individual components** tab. Choose what you want, and then follow the prompts.

### Step 6 - Install language packs (Optional)

By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the **Language packs** tab from the Visual Studio Installer, and then follow the prompts.

![Screenshot of the Visual Studio Installer, showing the Install language packs tab view.](../get-started/media/vs-installer-language-packs.png)

#### Change the installer language from the command line

Another way that you can change the default language is by running the installer from the command line. For example, you can force the installer to run in English by using the following command: `vs_installer.exe --locale en-US`. The installer will remember this setting when it's run the next time. The installer supports the following language tokens: zh-cn, zh-tw, cs-cz, en-us, es-es, fr-fr, de-de, it-it, ja-jp, ko-kr, pl-pl, pt-br, ru-ru, and tr-tr.

### Step 7 - Change the installation location (Optional)

You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.

> [!IMPORTANT]
> You can select a different drive only when you first install Visual Studio. If you've already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.

### Step 8 - Start developing

1. After Visual Studio installation is complete, choose the **Launch** button to get started developing with Visual Studio.

1. On the start window, choose **Create a new project**.

1. In the search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workload(s) that you chose during installation. To see different templates, choose different workloads.

You can also filter your search for a specific programming language by using the **Language** drop-down list. You can filter by using the **Platform** list and the **Project type** list, too.

1. Visual Studio opens your new project, and you're ready to code!

::: moniker-end

::: moniker range="msvc-160"

## Visual Studio 2019 Installation
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/get-started/tutorial-console-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ The usual starting point for a C++ programmer is a "Hello, world!" application t

Visual Studio uses *projects* to organize the code for an app, and *solutions* to organize your projects. A project contains all the options, configurations, and rules used to build your apps. It also manages the relationship between all the project's files and any external files. To create your app, first, you'll create a new project and solution.

1. If you've just started Visual Studio, you'll see the Visual Studio 2019 dialog box. Choose **Create a new project** to get started.
1. If you've just started Visual Studio, you'll see the Visual Studio Start dialog box. Choose **Create a new project** to get started.

![Screenshot of the Visual Studio 2019 initial dialog.](./media/calc-vs2019-initial-dialog.png "The Visual Studio 2019 initial dialog")
![Screenshot of the Visual Studio 2022 initial dialog.](./media/calc-vs2022-initial-dialog.png)

Otherwise, on the menubar in Visual Studio, choose **File** > **New** > **Project**. The **Create a new project** window opens.

Expand Down
4 changes: 2 additions & 2 deletions docs/overview/cpp-conformance-improvements.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Microsoft C/C++ in Visual Studio (MSVC) makes conformance improvements and bug f

This document lists the changes in Visual Studio 2022. For a guide to the changes in Visual Studio 2019, see [C++ conformance improvements in Visual Studio 2019](cpp-conformance-improvements-2019.md). For changes in Visual Studio 2017, see [C++ conformance improvements in Visual Studio 2017](cpp-conformance-improvements-2017.md). For a complete list of previous conformance improvements, see [Visual C++ What's New 2003 through 2015](../porting/visual-cpp-what-s-new-2003-through-2015.md).

## <a name="improvements_170_preview"></a> Conformance improvements in Visual Studio 2022 Preview and RC (version 17.0)
## <a name="improvements_170_preview"></a> Conformance improvements in Visual Studio 2022 version 17.0

Visual Studio 2022 Preview and RC version 17.0 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.
Visual Studio 2022 version 17.0 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.

### Warning on bitfield width for enumeration type

Expand Down
4 changes: 2 additions & 2 deletions docs/overview/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ items:
href: ../overview/visual-cpp-in-visual-studio.md
- name: Overview of C++ development in Visual Studio
href: ../overview/overview-of-cpp-development.md
- name: What's new for C++ in Visual Studio 2022 Preview
- name: What's new for C++ in Visual Studio 2022
href: ../overview/what-s-new-for-visual-cpp-in-visual-studio.md
- name: What's new for C++ in Visual Studio 2019
href: ../overview/what-s-new-for-cpp-2019.md
- name: What's new for C++ in Visual Studio 2017
href: ../overview/what-s-new-for-cpp-2017.md
- name: What's new for Microsoft C++ docs
href: ../overview/whats-new-cpp-docs.md
- name: C++ conformance improvements in Visual Studio 2022 Preview
- name: C++ conformance improvements in Visual Studio 2022
href: ../overview/cpp-conformance-improvements.md
- name: C++ conformance improvements in Visual Studio 2019
href: ../overview/cpp-conformance-improvements-2019.md
Expand Down
48 changes: 42 additions & 6 deletions docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
title: "What's new for C++ in Visual Studio"
description: "The new features and fixes in the Microsoft C/C++ compiler and tools in Visual Studio."
ms.date: 10/22/2021
ms.date: 11/05/2021
ms.technology: "cpp-ide"
ms.custom: intro-whats-new
---
# What's new for C++ in Visual Studio 2022 Preview
# What's new for C++ in Visual Studio 2022

Visual Studio 2022 brings many updates and fixes to the Microsoft C++ environment. We've added features and fixed many bugs and issues in the compiler and tools. The Visual Studio IDE also offers significant improvements in performance and productivity, and now runs natively as a 64-bit application. For more information on what's new in all of Visual Studio, visit [What's new in Visual Studio 2022](/visualstudio/ide/whats-new-visual-studio-2022?view=vs-2022&preserve-view=true). For information about what's new in the C++ docs, see [Microsoft C++ docs: What's new](whats-new-cpp-docs.md).

Expand All @@ -21,7 +21,11 @@ For a summary of new features and bug fixes in Visual Studio, see [What's New in

### Hot Reload for native C++

- [Hot Reload for C++](https://devblogs.microsoft.com/cppblog/edit-your-c-code-while-debugging-with-hot-reload-in-visual-studio-2022/) makes it possible to make many types of code edits to your running app and apply them without needing to pause app execution with something like a breakpoint. We've improved the Hot Reload experience in the debugger and the underlying Edit and Continue mechanism. Hot Reload now supports CMake and OpenFolder projects.
- [Hot Reload for C++](https://devblogs.microsoft.com/cppblog/edit-your-c-code-while-debugging-with-hot-reload-in-visual-studio-2022/) makes it possible to make many types of code edits to your running app and apply them without needing to pause app execution with something like a breakpoint.

In Visual Studio 2022, when you start your app in the debugger, you can use the Hot Reload button to modify your application while it's still running. This experience is powered by native Edit and Continue. For more information about supported edits, see [Edot and Continue (C++)](/visualstudio/debugger/edit-and-continue-visual-cpp?view=vs-2022&preserve-view=true).

- Hot Reload supports CMake and Open Folder projects.

### WSL2 support

Expand All @@ -41,6 +45,32 @@ For a summary of new features and bug fixes in Visual Studio, see [What's New in

- Implemented the **`/scanDependencies`** compiler option to list C++20 module dependencies for CMake projects, as described in [P1689r3](https://wg21.link/P1689r3). It's a step towards support for building modules-based projects with CMake and we're working on completing this support in later releases.

### Standard Library improvements

Select Standard Library (STL) improvements are highlighted here. For a comprehensive list of new functionality, changes, bug fixes, and performance improvements, see the STL team's [Changelog](https://github.com/microsoft/STL/wiki/Changelog#vs-2022).

- Added debugging visualizers to improve how the following types are displayed: `source_location`, `bind_front()`, `u8string` (and its iterators), `default_sentinel_t`, `unreachable_sentinel_t`, `ranges::empty_view`, `ranges::single_view`, `ranges::iota_view` (and its iterator/sentinel), `ranges::ref_view`, `thread`, `thread::id`, `jthread`, and `filesystem::path`
- Added `[[nodiscard]]` to the `stoi()` family of functions in `<string>` and to various functions in `<locale>` such as the `collate` member functions, `has_facet()`, and the `isalnum()` and `tolower()` families.
- [P0980R1](https://wg21.link/P0980R1) Made `std::string` `constexpr` in VS 2019 16.10. Now it's also supported for Clang.
- [P1004R2](https://wg21.link/P1004R2) Made `std::vector` `constexpr`in VS 2019 16.10. Now it's also supported for Clang.

**Highlighted C++23 features**

- [P1048R1](https://wg21.link/P1048R1) Added `is_scoped_enum`, a new trait for the C++ Standard library, which detects whether a type is a scoped enumeration.
- [P1132R7](https://wg21.link/P1132R7) `out_ptr()`, `inout_ptr()`
- [P1679R3](https://wg21.link/P1679R3) `contains()` For `basic_string` and `basic_string_view`
- [P1682R3](https://wg21.link/P1682R3) `to_underlying()` for enumerations
- [P2162R2](https://wg21.link/P2162R2) Allow inheriting from `std::variant`
- [P2166R1](https://wg21.link/P2166R1) Prohibit constructing`basic_string` and `basic_string_view` from `nullptr`. This is a source-breaking change. Code that previously had undefined behavior at runtime will now be rejected with compiler errors.
- [P2186R2](https://wg21.link/P2186R2) Removed garbage collection support. This removes `declare_reachable`, `undeclare_reachable`, `declare_no_pointers`, `undeclare_no_pointers`, `get_pointer_safety`. Previously, these functions had no effect.

**Highlighted performance improvements**

- `<format>` now detects when it's writing to a `back_insert_iterator` for a `basic_string` or a `vector`, and makes a faster call to `insert()` at the `end()` of the container.
- Improved the performance of `std::find()` and `std::count()` for `vector<bool>` 19x and 26x (times, not percent).
- Improved the performance of `std::count()` for `vector<bool>`
- `std::byte` now has the same performance as `unsigned char` in `reverse()` and `variant::swap()`

### Clang and LLVM support

- LLVM tools shipped with Visual Studio have been upgraded to LLVM 12. For more information, see the [LLVM release notes](https://releases.llvm.org/12.0.0/docs/ReleaseNotes.html).
Expand All @@ -63,7 +93,9 @@ For a summary of new features and bug fixes in Visual Studio, see [What's New in

- C++ IntelliSense for CMake projects now works when using a preset with a display name.

- Updated to NDK r21 LTS in C++ Mobile Development workload.
### C++ Workload updates

- Updated to NDK r21 LTS in the **C++ Mobile Development** workload.

- The **Game development with C++** workload now installs the latest Unreal Engine with support with for Visual Studio 2022.

Expand All @@ -79,11 +111,15 @@ For a summary of new features and bug fixes in Visual Studio, see [What's New in

## Release notes for older versions

Release notes for older C++ versions are also available. For information on what's new for C++ in Visual Studio 2019, see [What's new for C++ in Visual Studio 2019](what-s-new-for-cpp-2019.md). For information on what's new for C++ in Visual Studio 2017, see [What's new for C++ in Visual Studio 2017](what-s-new-for-cpp-2017.md). For information on what's new in earlier versions, see [Visual C++ What's New 2003 through 2015](../porting/visual-cpp-what-s-new-2003-through-2015.md).
Release notes for older C++ versions are also available. For information on what's new for C++ in Visual Studio 2019, see [What's new for C++ in Visual Studio 2019.](what-s-new-for-cpp-2019.md) For information on what's new for C++ in Visual Studio 2017, see [What's new for C++ in Visual Studio 2017.](what-s-new-for-cpp-2017.md) For information on what's new in earlier versions, see [Visual C++ What's New 2003 through 2015.](../porting/visual-cpp-what-s-new-2003-through-2015.md)

## Known issues

For more information on open issues and available workarounds for C++ in Visual Studio 2022, see the C++ Developer Community [issues list](https://developercommunity.visualstudio.com/search?space=62&stateGroup=active&ftype=problem&sort=votes&q=2022).
**C++ IntelliSense**

- [When importing a C++20 module or header unit, IntelliSense may stop working or 'There are too many errors' error is shown](https://aka.ms/vcmoduleintellisenseinfo).

For more information on other open issues and available workarounds for C++ in Visual Studio 2022, see the C++ Developer Community [issues list](https://developercommunity.visualstudio.com/search?space=62&stateGroup=active&ftype=problem&sort=votes&q=2022).

## Feedback and suggestions

Expand Down
Loading