Reputation: 131986
I want to try compiling some C++ code with Microsoft's C++ compiler, and using their standard C++ library. But, I would really rather not install their Visual Studio IDE. I have in the past installed "the whole enchilada", and the compiler naturally worked, but I recall it was really huge.
Now, I know Microsoft has a gratis Community Edition of its IDE, which includes its compiler, so I should be fine license-wise. Some browsing led me to this download site: https://visualstudio.microsoft.com/downloads/, but I only seem to be offered variants of Visual Studio, the IDE. If I search around for "Microsoft C++ Compiler", I either find Visual Studio sites, or downloads which seem more relevant scope-wise but are out of date, like this. Then there are Windows SDK's, I hope I don't have to get those, or do I? I also remember there are all sorts of "redistributable" packages you can download, and maybe other "build tools" packages - perhaps the compiler is really just a "build tool"?
If I do try the Visual Studio Community Edition installer - I ostensibly get the option to select which components I want to install. But, when I choose no components other than the "core C++ desktop features" (which probably means no compiler either), it wants to install 1.9 GB of data... and adding the MSVC v142 build tools bumps me up to 3.86 GB. Yikes!
Bottom line: What should I do so as to install just the MSVC compiler and the standard library (and the minimum possible set of other stuff I don't need alongside them)?
Note: This question is closely related to mine, but is not specifically about downloading and installing just the compiler and standard library. Hence one of the answers says: Download MSVS, but just run the compiler. The highest-scored answer ostensibly offers a Visual-Studio-independent download! ... except when you follow the link, you're immediately told the "build tools" are now part of Visual Studio 2017. IIUC anyway.
Upvotes: 2
Views: 3678
Reputation: 179991
Visual Studio Build Tools is indeed the correct version. I have it installed on our build server.
Yes, it's called "Visual Studio" like the other products in the line, but that doesn't mean it comes with an IDE. It does come with the Visual Studio Installer, so you can select the C++ compiler.
The basic install is vs_buildtools.exe –quiet –add Microsoft.VisualStudio.Workload.VCTools
. This is a C++ "workload" that's not available with the Visual Studio Community, where you'd use Microsoft.VisualStudio.Workload.NativeDesktop
instead.
Upvotes: 1