Setup C++ development environment on Windows
These steps were tested on Windows 11, 23H2. Scripts are PowerShell
.
Visual Studio 2022
This is needed for the C++ compiler. Install Visual Studio 2022 Community Edition.
During installation select C++ desktop development and latest Windows 10 and Windows 11 SDKs.
After installation open Visual Studio and check for updates. Install the latest 2022 version that is available.
CMake
Install via Windows Package Manager:
ninja
Install via Windows Package Manager:
PowerShell Configuration
This will allow you to execute PowerShell scripts locally on your machine. In PowerShell as Administrator:
Environment
Update $env:PSModulePath
so that you can use PowerShell modules. In PowerShell as Administrator:
[Environment]::SetEnvironmentVariable("PSModulePath", "$HOME/Documents/WindowsPowerShell/Modules;" + $env:PSModulePath, "Machine")
VSSetup Module
In PowerShell as Administrator:
Close and reopen PowerShell. Now you can use the VSSetup commands.List the Visual Studio installations:
This finds the installation path for Visual Studio 2022: