Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aont/f5191dc4699a708bd72e65273921b6a8 to your computer and use it in GitHub Desktop.

Select an option

Save aont/f5191dc4699a708bd72e65273921b6a8 to your computer and use it in GitHub Desktop.

Installing cl.exe with the Minimum Required Components

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.


1. Download Visual Studio Build Tools

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.


2. Install Only the Required Components

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.26100

Explanation of the components:

  • Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Installs the MSVC C/C++ compiler toolset for 32-bit (x86) and 64-bit (x64).

  • Microsoft.VisualStudio.Component.Windows11SDK.26100 Installs 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.


3. Summary

  • Download the Build Tools installer: https://aka.ms/vs/17/release/vs_BuildTools.exe

  • Install the minimal components for cl.exe and 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment