Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/MicrosoftDocs/cpp-docs/llms.txt

Use this file to discover all available pages before exploring further.

Getting MSVC up and running takes only a few minutes with the Visual Studio Installer. The installer uses a workload-based model, meaning you select high-level capability bundles (like “Desktop development with C++”) and it handles all the underlying component dependencies automatically. You can add or remove workloads at any time after the initial install. This guide walks through a full installation of Visual Studio 2022 with C++ support.
This guide covers Visual Studio on Windows. If you want a lightweight, cross-platform editor instead, see Visual Studio Code with the C/C++ extension. Visual Studio for Mac does not support Microsoft C++.

Before You Begin

Make sure your system meets the requirements and is in a clean state before starting the install:
  • Check the Visual Studio 2022 system requirements.
  • Apply all pending Windows Updates and reboot your computer before installing.
  • Free up disk space — a typical C++ installation requires 6–10 GB; a full install with all workloads can exceed 50 GB.
  • Visual Studio 2022 can be installed side-by-side with Visual Studio 2019 or 2017.

Installation Steps

1

Download Visual Studio

Go to the Visual Studio download page and choose your edition:
  • Community — Free for individuals, open-source, students, and classroom use.
  • Professional — For small teams and professional developers.
  • Enterprise — For large organizations requiring advanced testing and architectural tools.
Click the Free download (Community) or Free trial button. This downloads a small bootstrapper file called VisualStudioSetup.exe.
The Community edition includes the full C++ compiler, Standard Library, debugger, and all the workloads described below. It is the right choice for most individual developers.
2

Run the Bootstrapper

Locate VisualStudioSetup.exe in your Downloads folder and double-click it. If a User Account Control dialog appears, click Yes to allow the installer to run.The bootstrapper downloads and launches the Visual Studio Installer — a lightweight app that manages all future installs, updates, and modifications. Accept the Microsoft License Terms and Privacy Statement to continue.
3

Select the C++ Workload

The installer presents a list of workloads — curated collections of components for specific development scenarios. For C++ development, select:Desktop development with C++This workload installs:
  • MSVC v143 compiler and build tools
  • Windows 11 SDK (latest)
  • C++ core desktop features
  • C++ CMake tools for Windows
  • C++ AddressSanitizer
  • The Visual Studio debugger with native C++ support
The Installation details pane on the right shows exactly which components are included and lets you add optional extras.
4

Add Optional Components

Inside the Desktop development with C++ workload, you can select additional optional components. Common choices include:
Already included by default in VS 2022. Provides full CMake integration: open any folder containing a CMakeLists.txt and Visual Studio configures IntelliSense and build targets automatically.
Install previous toolset versions (Visual Studio 2017 v141 or 2019 v142) to build projects that require older ABI compatibility. You can then set the Platform Toolset per-project in Properties.
Installs Clang/LLVM as an alternative compiler front-end. Useful for cross-platform projects that also build with Clang on Linux or macOS, or for leveraging Clang-specific sanitizers.
A separate workload — scroll down to find it. Required for building C++ code that runs on Linux machines or WSL. See the Linux Tutorial for details.
Adds integration with DirectX, Unreal Engine, and Cocos2d. Select this if you are building Windows or Xbox games.
5

Choose an Installation Location (Optional)

By default, Visual Studio installs to C:\Program Files\Microsoft Visual Studio\2022\. You can move the download cache, shared components, and SDKs to different drives via the Installation locations tab. The IDE itself should remain on your fastest drive.
You can only choose a different drive during the initial installation. Changing the drive after installation requires a complete uninstall and reinstall.
6

Install

Click the Install button. The installer downloads and installs all selected components. Progress is shown in real time. Installation time varies depending on your internet speed and selected components — typically 10–20 minutes for a standard C++ install.You can continue using your computer during installation. Visual Studio does not need to be running during download.
7

Launch and Configure Visual Studio

When installation completes, click Launch. On first run:
  1. Sign in with a Microsoft Account (optional, but required after 30 days for Community edition and needed for GitHub Copilot).
  2. Choose a color theme (Dark, Light, or Blue). You can change this later in Tools > Options > Environment > General.
  3. Visual Studio finishes loading its component catalog — this may take a minute the first time.
Once the Start Window appears, you’re ready to create or open a C++ project.
8

Verify Your Installation

To confirm C++ support is working, create a quick test project:
  1. Click Create a new project on the Start Window.
  2. In the search box, type Console App and select the template tagged C++, Windows, Console.
  3. Name the project TestInstall and click Create.
  4. Press Ctrl+Shift+B to build. The Output window should show:
Build started...
1>------ Build started: Project: TestInstall, Configuration: Debug x64 ------
1>TestInstall.cpp
1>TestInstall.vcxproj -> ...\TestInstall\x64\Debug\TestInstall.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
A successful build confirms the compiler, linker, and Windows SDK are all correctly installed.

Adding or Removing Workloads Later

You can modify your installation at any time without reinstalling from scratch:
  1. Open the Visual Studio Installer from the Windows Start menu.
  2. Click Modify next to your Visual Studio installation.
  3. Check or uncheck workloads and individual components.
  4. Click Modify to apply changes.
Alternatively, from inside Visual Studio, go to Tools > Get Tools and Features… to open the installer directly.

Installing the Standalone Build Tools

If you only need the compiler and build system (for CI/CD pipelines, servers, or minimal developer machines without the IDE), download the Microsoft C++ Build Tools from visualstudio.microsoft.com/visual-cpp-build-tools. The Build Tools installer uses the same workload model and installs cl.exe, link.exe, MSBuild, and the Windows SDK without the IDE.
rem Set up the x64 build environment from the command line
"C:\Program Files\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
cl.exe /std:c++20 /EHsc hello.cpp

Build docs developers (and LLMs) love