This article explains how to install the Microsoft C/C++ compiler (cl.exe) with a minimal setup, without installing the full Visual Studio IDE. This is useful when you only need the build tools, for example on a CI server or in a lightweight development environment.
First, download the Visual Studio Build Tools installer from the following link:
https://aka.ms/vs/17/release/vs_BuildTools.exe
Save this file as vs_BuildTools.exe in a suitable folder.
Next, run the installer with options to add only the components needed for cl.exe and the Windows 11 SDK.
Use the following command:
vs_BuildTools.exe --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows11SDK.26100Explanation of the components:
-
Microsoft.VisualStudio.Component.VC.Tools.x86.x64Installs the MSVC C/C++ compiler toolset for 32-bit (x86) and 64-bit (x64). -
Microsoft.VisualStudio.Component.Windows11SDK.26100Installs the Windows 11 SDK (version 26100), which provides the headers and libraries required to build Windows applications.
No additional options such as --quiet, --wait, or --norestart are used here, so the installer will run in normal interactive mode.
-
Download the Build Tools installer:
https://aka.ms/vs/17/release/vs_BuildTools.exe -
Install the minimal components for
cl.exeand the Windows 11 SDK with:vs_BuildTools.exe --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows11SDK.26100
With these steps, you can prepare a minimal environment that includes cl.exe and the Windows 11 SDK, without installing the full Visual Studio IDE.