You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you haven't downloaded and installed Visual Studio and the Microsoft C/C++ tools yet, here's how to get started.
13
13
14
+
::: moniker range="msvc-170"
15
+
16
+
## Visual Studio 2022 Installation
17
+
18
+
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.
19
+
20
+
> [!NOTE]
21
+
> 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/).
22
+
23
+
Want to know more about what else is new in this version? See the Visual Studio [release notes](/visualstudio/releases/2022/release-notes/).
24
+
25
+
Ready to install? We'll walk you through it, step-by-step.
26
+
27
+
### Step 1 - Make sure your computer is ready for Visual Studio
28
+
29
+
Before you begin installing Visual Studio:
30
+
31
+
1. Check the [system requirements](/visualstudio/releases/2022/system-requirements). These requirements help you know whether your computer supports Visual Studio 2022.
32
+
33
+
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.
34
+
35
+
1. Reboot. The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.
36
+
37
+
1. Free up space. Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.
38
+
39
+
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.
40
+
41
+
### Step 2 - Download Visual Studio
42
+
43
+
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.
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.
51
+
52
+
1. From your **Downloads** folder, double-click the bootstrapper that matches or is similar to one of the following files:
53
+
54
+
-**vs_community.exe** for Visual Studio Community
55
+
-**vs_professional.exe** for Visual Studio Professional
56
+
-**vs_enterprise.exe** for Visual Studio Enterprise
57
+
58
+
If you receive a User Account Control notice, choose **Yes** to allow the bootstrapper to run.
59
+
60
+
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**.
61
+
62
+
### Step 4 - Choose workloads
63
+
64
+
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.
65
+
66
+
1. Find the workload you want in the **Installing Visual Studio** screen.
67
+
68
+

69
+
70
+
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.
71
+
72
+
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.
73
+
74
+
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.
75
+
76
+
1. After you choose the workload(s) and optional components you want, choose **Install**.
77
+
78
+
Next, status screens appear that show the progress of your Visual Studio installation.
79
+
80
+
> [!TIP]
81
+
> 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**.
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.
86
+
87
+
### Step 6 - Install language packs (Optional)
88
+
89
+
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.
90
+
91
+

92
+
93
+
#### Change the installer language from the command line
94
+
95
+
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.
96
+
97
+
### Step 7 - Change the installation location (Optional)
98
+
99
+
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.
100
+
101
+
> [!IMPORTANT]
102
+
> 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.
103
+
104
+
### Step 8 - Start developing
105
+
106
+
1. After Visual Studio installation is complete, choose the **Launch** button to get started developing with Visual Studio.
107
+
108
+
1. On the start window, choose **Create a new project**.
109
+
110
+
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.
111
+
112
+
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.
113
+
114
+
1. Visual Studio opens your new project, and you're ready to code!
Copy file name to clipboardExpand all lines: docs/get-started/tutorial-console-cpp.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ The usual starting point for a C++ programmer is a "Hello, world!" application t
21
21
22
22
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.
23
23
24
-
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.
24
+
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.
25
25
26
-

26
+

27
27
28
28
Otherwise, on the menubar in Visual Studio, choose **File** > **New** > **Project**. The **Create a new project** window opens.
Copy file name to clipboardExpand all lines: docs/overview/cpp-conformance-improvements.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,9 @@ Microsoft C/C++ in Visual Studio (MSVC) makes conformance improvements and bug f
10
10
11
11
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).
12
12
13
-
## <aname="improvements_170_preview"></a> Conformance improvements in Visual Studio 2022 Preview and RC (version 17.0)
13
+
## <aname="improvements_170_preview"></a> Conformance improvements in Visual Studio 2022 version 17.0
14
14
15
-
Visual Studio 2022 Preview and RC version 17.0 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.
15
+
Visual Studio 2022 version 17.0 contains the following conformance improvements, bug fixes, and behavior changes in the Microsoft C++ compiler.
16
16
17
17
### Warning on bitfield width for enumeration type
Copy file name to clipboardExpand all lines: docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md
+42-6Lines changed: 42 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
2
title: "What's new for C++ in Visual Studio"
3
3
description: "The new features and fixes in the Microsoft C/C++ compiler and tools in Visual Studio."
4
-
ms.date: 10/22/2021
4
+
ms.date: 11/05/2021
5
5
ms.technology: "cpp-ide"
6
6
ms.custom: intro-whats-new
7
7
---
8
-
# What's new for C++ in Visual Studio 2022 Preview
8
+
# What's new for C++ in Visual Studio 2022
9
9
10
10
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).
11
11
@@ -21,7 +21,11 @@ For a summary of new features and bug fixes in Visual Studio, see [What's New in
21
21
22
22
### Hot Reload for native C++
23
23
24
-
-[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.
24
+
-[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.
25
+
26
+
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).
27
+
28
+
- Hot Reload supports CMake and Open Folder projects.
25
29
26
30
### WSL2 support
27
31
@@ -41,6 +45,32 @@ For a summary of new features and bug fixes in Visual Studio, see [What's New in
41
45
42
46
- 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.
43
47
48
+
### Standard Library improvements
49
+
50
+
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).
51
+
52
+
- 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`
53
+
- 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.
54
+
-[P0980R1](https://wg21.link/P0980R1) Made `std::string``constexpr` in VS 2019 16.10. Now it's also supported for Clang.
55
+
-[P1004R2](https://wg21.link/P1004R2) Made `std::vector``constexpr`in VS 2019 16.10. Now it's also supported for Clang.
56
+
57
+
**Highlighted C++23 features**
58
+
59
+
-[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.
-[P1679R3](https://wg21.link/P1679R3)`contains()` For `basic_string` and `basic_string_view`
62
+
-[P1682R3](https://wg21.link/P1682R3)`to_underlying()` for enumerations
63
+
-[P2162R2](https://wg21.link/P2162R2) Allow inheriting from `std::variant`
64
+
-[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.
65
+
-[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.
66
+
67
+
**Highlighted performance improvements**
68
+
69
+
-`<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.
70
+
- Improved the performance of `std::find()` and `std::count()` for `vector<bool>` 19x and 26x (times, not percent).
71
+
- Improved the performance of `std::count()` for `vector<bool>`
72
+
-`std::byte` now has the same performance as `unsigned char` in `reverse()` and `variant::swap()`
73
+
44
74
### Clang and LLVM support
45
75
46
76
- 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).
@@ -63,7 +93,9 @@ For a summary of new features and bug fixes in Visual Studio, see [What's New in
63
93
64
94
- C++ IntelliSense for CMake projects now works when using a preset with a display name.
65
95
66
-
- Updated to NDK r21 LTS in C++ Mobile Development workload.
96
+
### C++ Workload updates
97
+
98
+
- Updated to NDK r21 LTS in the **C++ Mobile Development** workload.
67
99
68
100
- The **Game development with C++** workload now installs the latest Unreal Engine with support with for Visual Studio 2022.
69
101
@@ -79,11 +111,15 @@ For a summary of new features and bug fixes in Visual Studio, see [What's New in
79
111
80
112
## Release notes for older versions
81
113
82
-
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).
114
+
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)
83
115
84
116
## Known issues
85
117
86
-
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).
118
+
**C++ IntelliSense**
119
+
120
+
-[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).
121
+
122
+
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).
0 commit comments