As per the title. I don't want to download the entire Visual C++ installer, only "cl.exe" and the other programs required for compiling and linking C++ programs on Windows.
-
1I marked the "it's not possible" answer as correct, because it is indeed impossible (as far as I can tell) to download the command line compiler separately, which is what the question asked. I do understand from Nayana's answer that it's possible to have the CLI compiler *installed* without visual studio *installed* (by manually moving the required files from the installation), but the question specifically asked about *downloading* a package without download the entire visual studio. – magnus Mar 10 '14 at 05:29
-
3@user1420752: the point was that, as a matter of courtesy, you should wait long enough for others to reply. Even if an answer is 'good enough' there could be a better one from a different timezone. Playing nice counts for a lot around here. – david.pfx Mar 10 '14 at 14:25
-
@david.pfx. Point taken. I'll wait before marking an answer as correct in future. – magnus Mar 11 '14 at 01:12
-
6Just had this issue too and am frustrated enough to need to comment. I'm now forced to install a 3gig download just to use a commandline tool that I imagine is a few hundred megs AT MOST! Infuriating :( – Jul 26 '14 at 08:54
-
I once downloaded an archive (not official) which only contains the compiler, it also had two batch files to start the command lines corresponding to x86 and x64. I've used it along with codeblocks, worked perfectly. Now I no longer develop stuff for Windows and that package was lost. So, yeah, it was out there. – Madwyn Oct 22 '15 at 14:10
-
2Just a note: while you can use MSVC2015 Build Tools as a command line compiler, note that this "weights" at least 3GB (and much more for Windows 8.1 / 10 SDK support), where the good old MSVC Express 2010 with its IDE (which you could never open it and just compile with `cl.exe`) it's not even 0.5 GB. MSVC2015 Build Tools does not even set PATH and you'll get errors of not finding folders... – Jan 01 '16 at 18:00
-
13It's now supported by Microsoft. http://blogs.msdn.com/b/vcblog/archive/2015/11/02/announcing-visual-c-build-tools-2015-standalone-c-tools-for-build-environments.aspx – Roland Barbe Nov 06 '15 at 02:27
-
my 5c: just download & install the SDK (e.g. https://www.microsoft.com/en-us/download/details.aspx?id=3138) - it should have all the necessary command line tools, includes & libs, and some extra tools necessary. During the install, uncheck all the samples/docs/support/C# stuff to get literally only the compiler/linker, includes & libs. – Apr 12 '16 at 14:40
-
Instead of the blogs that are linked to above, please visit the official landing page at http://landinghub.visualstudio.com/visual-cpp-build-tools. It'll be kept up to date. – apardoe Jun 10 '16 at 20:37
-
1@RolandBarbe: unfortunately that link only refers to the web installer. For any serious development that's insufficient, since you'll want to archive a copy of your toolchain for reproducible builds. – 0xC0000022L Feb 02 '17 at 16:29
-
1@apardoe unfortunately the "official landing page" is now a 404, I guess they stopped updating it – jrh Sep 30 '20 at 16:41
-
1https://visualstudio.microsoft.com/visual-cpp-build-tools/ – Al Mahdi Jul 06 '22 at 07:17
-
As an alternative solution, you could consider using Mingw-w64 GCC and LLVM Clang compilers coming as packages inside MSYS2. – Foad S. Farimani Nov 10 '22 at 19:19
11 Answers
As said, there is no way to do that. You need to download the entire 4-6GB+ bundle. MS deployment is a botch.
There is no need, however, to actually install everything. If you're up to some manual installation, you can extract individual components from the bundle and put them all in a more organized directory tree.
For example, I've found the following set to be the bare minimum needed for using the current MSVC2013 compilers in a x86 environment:
vc_compilerCore86.msi
: MSVC toolchain;vc_compilerCore86res.msi
: MSVC toolchain MUI resources;vc_librarycore86.msi
: MSVC library stuff;vc_LibraryDesktopX86.msi
: More MSVC library stuff;Windows Software Development Kit for Windows Store Apps-x86_en-us.msi
: Windows SDK files and related tools (rc.exe
,mt.exe
, etc.);Windows Software Development Kit-x86_en-us.msi
: More Windows SDK files (specifically,WinSock2.h
,WS2_32.lib
, maybe others).
Remember that you can extract the contents of a MSI file by running msiexec /a <msifile> TARGETDIR="<path>"
(jot a /quiet
parameter if you're batching). Of course, you can also put more into your package by investigating the MSI files inside the bundle. In particular, the above set is missing the latest MSBuild tools, since I don't care for them. Stuff is often scattered around between multiple MSIs cluelessly, so good luck.
I've got a 50MB (!!!) 7z-file containing this set for local deployment, though I cannot share this publicly due to Microsoft licensing restrictions.
UPDATE:
This is the list of MSI files for MSVC2015 tools, headers and libraries:
packages\VisualC_D14\VC_Tools.Core\VC_Tools.Core.msi
packages\VisualC_D14\VC_Tools.Core.Res\VC_Tools.Core.Res.msi
packages\VisualC_D14\VC_Tools.X86.Base\VC_Tools.X86.Base.msi
packages\VisualC_D14\VC_Tools.X86.Base.Res\VC_Tools.X86.Base.Res.msi
packages\VisualC_D14\VC_Tools.X86.Nat\VC_Tools.X86.Nat.msi
packages\VisualC_D14\VC_Tools.X86.Nat.Res\VC_Tools.X86.Nat.Res.msi
packages\VisualC_D14\VC_Tools.X86.X64\VC_Tools.X86.X64.msi
packages\VisualC_D14\VC_Tools.X86.X64.Res\VC_Tools.X86.X64.Res.msi
packages\VisualC_D14\VC_PremTools.X86.Base\VC_PremTools.X86.Base.msi
packages\VisualC_D14\VC_PremTools.X86.Base.Res\VC_PremTools.X86.Base.Res.msi
packages\VisualC_D14\VC_PremTools.X86.Nat\VC_PremTools.X86.Nat.msi
packages\VisualC_D14\VC_PremTools.X86.Nat.Res\VC_PremTools.X86.Nat.Res.msi
packages\VisualC_D14\VC_PremTools.X86.X64\VC_PremTools.X86.X64.msi
packages\VisualC_D14\VC_PremTools.X86.X64.Res\VC_PremTools.X86.X64.Res.msi
packages\VisualC_D14\VC_CRT.Headers\VC_CRT.Headers.msi
packages\VisualC_D14\VC_CRT.X86.Desktop\VC_CRT.X86.Desktop.msi
packages\VisualC_D14\VC_CRT.X86.Store\VC_CRT.X86.Store.msi
packages\VisualC_D14\VC_CRT.X64.Desktop\VC_CRT.X64.Desktop.msi
packages\VisualC_D14\VC_CRT.X64.Store\VC_CRT.X64.Store.msi
packages\VisualC_D14\VC_CRT.Redist.Res\VC_CRT.Redist.Res.msi
packages\VisualC_D14\VC_CRT.Redist.X86\VC_CRT.Redist.X86.msi
packages\VisualC_D14\VC_CRT.Redist.X64\VC_CRT.Redist.X64.msi
packages\VisualC_D14\VC_ATL.Headers\VC_ATL.Headers.msi
packages\VisualC_D14\VC_ATL.X86\VC_ATL.X86.msi
packages\VisualC_D14\VC_ATL.X64\VC_ATL.X64.msi
packages\VisualC_D14\VC_MFC.Headers\VC_MFC.Headers.msi
packages\VisualC_D14\VC_MFC.X86\VC_MFC.X86.msi
packages\VisualC_D14\VC_MFC.X64\VC_MFC.X64.msi
packages\VisualC_D14\VC_PGO.Headers\VC_PGO.Headers.msi
packages\VisualC_D14\VC_PGO.X86\VC_PGO.X86.msi
packages\VisualC_D14\VC_PGO.X64\VC_PGO.X64.msi
packages\Win10_UniversalCRTSDK\Universal CRT Headers Libraries and Sources-x86_en-us.msi
And this is the list of MSI files for WinSDK10 tools, headers and libraries (downloaded separately):
Installers\Windows SDK Desktop Headers Libs Metadata-x86_en-us.msi
Installers\Windows SDK Desktop Tools-x86_en-us.msi
Installers\Windows SDK for Windows Store Apps Headers Libs-x86_en-us.msi
Installers\Windows SDK for Windows Store Apps Tools-x86_en-us.msi
All of this include stuff for both x86
and x64
(I haven't considered ARM or IA64). Both bundles compressed with LZMA will yield a 185MB file.

- 4,882
- 2
- 29
- 55
-
6Adding `vc_LibraryDesktopX64.msi` seems to be the bare minimum for x64 builds. – nwellnhof Jul 24 '15 at 18:18
-
-
@AnHoa: For MSVC, you extract them from the ISO. For WinSDK, you download the web installer and run `setup.exe /layout
`. The web installer will download them (without installing) to the directory specified. – alecov Jan 13 '16 at 15:45 -
[Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools). – IInspectable Jul 24 '16 at 22:57
-
So essentially you say if I just copy bunch of directories from an existing install, I can have compiler working? and those would be several dirs from VC, and maybe Common7. right? – Slava Jun 13 '18 at 09:46
-
posted a feature request [here](https://developercommunity.visualstudio.com/idea/954596/installing-the-command-line-only-compilers-without.html) – Foad S. Farimani Mar 18 '20 at 21:41
In 2014 you could not download the Visual C++ compiler alone from Microsoft.
It used to be that you could. Then it used to be that you could get it in the Platform SDK. Then you could only get it by installing Visual Studio.
Happily, at that time, the compiler that was bundled with Visual Studio Express for Desktop (the free version of Visual Studio at the time) was, and is, the very same that you get with Professional or Universal editions.
In November 2015 Microsoft again started providing the compiler tools in a free-standing package called the Visual C++ Build Tools.
Microsoft writes:
” the C++ Build Tools installer will not run on a machine with Visual Studio 2015 already installed on it. The reverse (i.e. upgrade to Visual Studio) is supported.
The long term situation is, as always, unclear. And, disclaimer: I have not used the build tools myself – I would have to uninstall Visual Studio first.

- 232,980
- 40
- 330
- 338

- 142,714
- 15
- 209
- 331
-
https://www.visualstudio.com/support/legal/dn877550 If you are an enterprise, your employees and contractors may not use the software to develop or test your applications, except for open source and education purposes as permitted above. An “enterprise” is any organization and its affiliates who collectively have either (a) more than 250 PCs or users or (b) more than one million US dollars (or the equivalent in other currencies) in annual revenues, and “affiliates” means those entities that control (via majority ownership), are controlled by, or are under common control with an organization. – NotAgain Sep 28 '15 at 07:03
-
So if I want to compile the VC++ projects on buildserver in my company, I cannot install "Microsoft Visual Studio Community 2013". And we do not have Ultimate edition of Visual Studio. – NotAgain Sep 28 '15 at 07:04
-
When you work in an enterprise with more than 250 PCs, or more than one million US dollars in revenue, and I did in the 1990s, then obtaining a proper version of Visual Studio is as easy as saying that you need it, or contacting the IT support folks, or even just access the software collection yourself. Or at least it *should* be that easy. It's generally not a good idea to use development tools that your company doesn't provide, because then others will have problems maintaining things. – Cheers and hth. - Alf Sep 28 '15 at 07:19
I ended up using Chocolatey, which has a package for Visual C++ Build Tools.
This command:
choco install visualcpp-build-tools
will install the latest 2017 version, but you can select one of the older versions, which include the 2015 release.
After the installation Visual Studio 2017 folder is added to the Programs menu. It includes shortcuts to various developer command prompts with cl.exe and other tools in the path.

- 617
- 5
- 13
-
Sure, https://community.chocolatey.org/packages/visualstudio2019buildtools. Mind though that it's a different package. – GreenhouseVeg May 22 '21 at 10:30
As of 2019 Microsoft offers Visual Studio Build Tools which only includes the compiler, build tools and SDK. It's hidden in the all downloads list.

- 674
- 1
- 8
- 22
-
8Looks like a networked mini installer. It's 1.3MB. Cannot be archived, copied over and installed offline. Will certainly break soon, i.e. less than 5 years, once MS shuts their servers down. No idea if it can be installed noninteractively. No idea if several versions can cohabitate. No idea how to select one specific version. Still complicated and obscure compared to any linux distro, or even building gcc or clang by yourself. No idea about the licence. Discouraging. – Johan Boulé Sep 30 '19 at 15:34
-
3@JohanBoulé There is extensive MSDN documentation regarding pretty much all of those topics by now. For example, offline installation is possible using [local cache](https://learn.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio?view=vs-2019#use-the-command-line-to-create-a-local-cache) or [network cache](https://learn.microsoft.com/en-us/visualstudio/install/create-a-network-installation-of-visual-studio?view=vs-2019). – Max Truxa Jun 03 '20 at 13:38
-
4@MaxTruxa Thanks for the links. It looks like a sophisticated process that would need quite some time to investigate. I think they might someday fill the need of people who don't want to select various packages from the 35GB set and just want the bare compiler, linker and core libraries, in a single portable archive we can extract where ever we want. – Johan Boulé Jun 08 '20 at 20:34
Update: The Visual C++ 2015 Build Tools are located here: http://landinghub.visualstudio.com/visual-cpp-build-tools
The Visual C++ 2017 Build Tools are now part of the regular VS 2017 installer. Just select the workloads you need. Information is on the same page.
This link is preferred to the blog links below as it's the official landing page and will be kept up-to-date.
I'm on the C++ team. If you have any questions about using the VC++ Build Tools or about MSVC in general, feel free to email me. My email is my StackOverflow user name @microsoft.com.
Once I tried to do same this as you. But MS doesn't provide isolated compiler. So if you need MS C++ compiler you must need to install the VS. But if you like to adventure. there is a tricky way to do that. Try it here. Chrees!

- 23,596
- 30
- 104
- 147
-
1+1. This is helpful, in that you can get it working without the full install. I haven't marked this as correct though, because the question asked whether it could be downloaded separately, not downloaded in full and manually copying and pasting the required files. – magnus Mar 10 '14 at 05:26
On March 21, 2022, the best I could figure out was to find the "Visual Studio Community" free download (required logging in with Microsoft account). There was no longer any "just give me the damn Build Tools" concept, but there is the promise that you just download an installer and then pick. So I downloaded the installer and ran it.
Of course, none of the top-level options are suitable for "just give me the damn Build Tools", so I pick the "Individual Components" option. This supplies an incredibly large list of things I don't want, but buried within it I find "MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)" which looks hopeful. I check that box and I'm informed they will give me also "Visual Studio code editor".
I'm sternly warned that I'm installing "without workloads", which seems to be some additional crap that the "Visual Studio core editor" I'm never going to use wants. I decline the additional bloatware. Some gigabytes later, it says I'm "Done installing" but warns "We recommend rebooting soon to clean up any remaining files."
After decades of (re-)writing scripts to locate the Microsoft compiler, I bow to Microsoft's superior ability to keep breaking any easy method of automating this process. Whenever I install the Microsoft compiler on a system, I manually set a system-wide environment variable that points to the Microsoft batch file for setting shell environment variables for the tools. Today's machine is a no-license (hey, Microsoft sucks the same way, just not as much!) Windows 10, and that is <Winkey>-x | System | Advanced System settings | Environment Variables
I create a variable called RLBVCVARS
and set it to (in this particular case) c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat
My portable Windows dev environment keeps an alias that points to that so, I can mostly pretend Microsoft doesn't constantly introduce breaking changes to their installation schemes. I think you have to reboot for a "system" environment variable to take effect, but hey, Microsoft wants you to reboot after installing anything anyway, so no biggy.
First compile says can't find "io.h". Back to the installer. Let's try adding "Windows 10 SDK" (3 versions to choose from!). A GB or so later, I have an io.h and can build my current project. Onward and upward.

- 6,058
- 1
- 18
- 20
-
I combined this with the [this](https://stackoverflow.com/a/68095191/2965879) other answer, installing "MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)", the latest "Windows 11 SDK", plus "C++ CMake tools for windows", "Testing tools core features - Build Tools", and the "Windows Universal C Runtime". Worked first go – Axel Mar 21 '23 at 07:41
As of the time of writing (June 23, 2021), the following info is taken from Configure VS Code for Microsoft C++.
Here is the important quote:
You can also install just the C++ Build Tools, without a full Visual Studio IDE installation. From the Visual Studio Downloads page, scroll down until you see Tools for Visual Studio under the All downloads section and select the download for Build Tools for Visual Studio.
This will launch the Visual Studio Installer, which will bring up a dialog showing the available Visual Studio Build Tools workloads. Check the C++ build tools workload and select Install.
Note: You can use the C++ toolset from Visual Studio Build Tools along with Visual Studio Code to compile, build, and verify any C++ codebase as long as you also have a valid Visual Studio license (either Community, Pro, or Enterprise) that you are actively using to develop that C++ codebase.

- 14,188
- 21
- 90
- 165
-
For the sake of convenience and avoiding errors, Visual Studio Code must be open via Developer Command Prompt. If you are targeting x64 bit output then open VS Code with x64 Developer Command Prompt. Failure doing so will generate errors. – Second Person Shooter Jun 24 '21 at 01:46
You can use MSVC compiler without Visual Studio and the latest version is available here:
http://www.microsoft.com/en-us/download/details.aspx?id=41151
Also here's a website which details the command line options for the compiler:

- 4,852
- 6
- 40
- 66
-
4I already tried the above download. The installation did complete, as it informed me that Visual Studio was not installed, and was required. I think the above installer adds a **new** compiler to an **existing** Visual Studio installation, in order to enable the C++11 and C++14 features. – magnus Mar 10 '14 at 01:36
-
4@user1420752: Correct. "This package requires VIsual Studio 2013 to be pre-installed " – MSalters Mar 10 '14 at 10:45
As what stated in visual c++ 2015 tools for windows desktop
- Mount your VS2015.iso
- You can find all packages at your mounted location E:\packages | G:\packages
- Navigate to Control Panel.
- Right-Click at your VS2015 and choose change-modify
- Check the Visual C++ boxes as stated in the link.
- Click on Modify.
- If installer fail to update, copy the mounted directory location and paste on it.
- Click Retry button.

- 61
- 1
- 5