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.
You can build C and C++ applications on the command line by using tools that are included in Visual Studio. The Microsoft C++ (MSVC) compiler toolset is also downloadable as a standalone package. You don't need to install the Visual Studio IDE if you don't plan to use it.
Visual Studio comes with its own C compiler, which is actually the C++ compiler. Just use the . c file extension to save your source code. You don't have to be using the IDE to compile C.
You can get the command-line compiler (csc.exe) from Microsoft site http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx. Download the redistributable package of the . NET Framework, which includes the compiler and the . NET Framework with C# 2005 syntax support.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With