r/AskProgramming • u/NeedSomeHelp_2590 • Sep 12 '26
C/C++ Best and easy to install compiler for C/C++?
Just started learning C and currently using Online Compiler. Now thinking of switching to VS Code, did some searches and found you just need a compiler.
And I came across MinGW and Clang. The process of getting MinGW to work is not that simple so thinking of getting Clang. There aren't any tutorial for this on Windows, so I am assuming you just to get LLVM 23.1.1 from their website and install it, right?
Also which one is better or both are same?
EDIT: Got the compiler (MSVC) through Visual Studio Installer. And everything seems to be working fine after installing C\C++ extension in VS Code. Thanks for the help everyone!!
15
u/Big-Rub9545 Sep 12 '26
You can always use WSL on Windows and just install gcc or clang directly on there.
2
u/IchBinEinZwerg Sep 13 '26
Since you're obviously not boycotting Microsoft, and at your stage you won't need to build installers yet, why not just install Visual Studio Community? This works straight out of the box without any fannying around and smashes your "easy" requirement, and the Visual Studio compilers are very strong products, possibly not "best" depending how you define that, but as with installers you're a long way off hitting any of its limitations.
1
u/KingofGamesYami Sep 12 '26
Since you're on Windows, I'd recommend using the native compiler (MSVC). Here's docs on how to set up VSCode with it:
https://code.visualstudio.com/docs/cpp/config-msvc
Note: although the docs reference C++, the same configuration applies to C.
1
u/Accomplished_Fix9569 Sep 12 '26
Clang on Windows depends on the MSVC linker. You still have to install the MSVC build tools anyway.
Install Visual Studio through the installer and select the Desktop development with C++ workload. It puts MSVC on your machine and configures the paths for you. Then follow the VS Code MSVC docs in comment 2.
1
u/Witty-Dentist964 Sep 12 '26
start with Clang for simpler route on windows if using VS Code
1
u/ern0plus4 Sep 12 '26
Install Chocolatey, then you can install stuff easy-peasy, like on Mac (brew) or GNU/Linux.
1
u/jason-reddit-public Sep 13 '26
clang on Windows is great but you still need to get windows headers from somewhere I think. The MS tools are free to download as well though clang may have better error messages.
1
u/Milumet Sep 12 '26
You just download it, put in into a directory and add the executable subdirectory to PATH.
6
u/[deleted] Sep 12 '26
[removed] β view removed comment
1
u/[deleted] Sep 12 '26
[removed] β view removed comment