Reputation: 532
I'm trying to run C code on my Windows, but I have a low-end PC, and I don't think I should install Visual Studio.
How do I only install the C/C++ compiler that comes with it, without installing Visual Studio itself.
Upvotes: 27
Views: 64751
Reputation: 5796
What you want is called the "Windows SDK", which contains everything you need to build applications on Windows, except the IDE (Visual Studio).
It comes with all necessary libraries, header files, a compiler, nmake et cetera, and a handy shortcut for a preconfigured cmd.exe
that puts all of these tools in your PATH
. If you know what you are doing, this is what you want to use.
What version of the SDK you want depends on the system you are compiling on, but you will find all of them on the Microsoft website. For Windows 10 for example, the SDK can be found here: https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk
Be aware, though, that the windows' compiler cl.exe
can be a bit tricky at times, and nmake is not what you expect when you only learned GNUmake. If all you want is to compile on Windows, without having to drag 20+ Gigabytes of IDE around, then the SDK is an option to consider.
(We are using virtual machines with a preinstalled Windows SDK quite successfully in lectures and exercises.)
As of Windows 8 the SDK no longer contains the build tools for C++ based applications. These are now only contained in a Visual Studio installation.
Upvotes: 13
Reputation: 42666
You can download the compiler and related stuff as part of the Visual Studio Build Tools. The 2017 version is here:
https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017
Upvotes: 9