r/C_Programming • • Sep 05 '26

Discussion Setting up c on windows.

Can somebosy walk me tru setting up c and clangd on windows ice tried for a day or 2 but cant get it right with kate,some help whuld be really apreciated.

0 Upvotes

19 comments sorted by

5

u/TheOtherBorgCube Sep 05 '26

https://www.codeblocks.org/downloads/binaries/

Grab codeblocks-25.03mingw-setup.exe (or whatever the latest x.y version of that file is). This includes the IDE and the compiler.

The default compiler is gcc (because mingw), but you can install other toolchains later if you wanted to.

It's a bit like VS, but you'll be up and running in minutes instead of hours, and without having to promise your first born to M$.

1

u/ZulfiqarShadow Sep 05 '26

I think this might actually be the exact answer i was looking for, thanks!

4

u/EpochVanquisher Sep 05 '26

Have you tried installing Visual Studio? This is the fastest way.

4

u/ZulfiqarShadow Sep 05 '26

I will keep that in mind but my system is a bit old and vs is slugish.

3

u/musbur Sep 05 '26

Unless you need that sluggish machine for other sluggish things I'd throw Linux on it and have a snappy C dev machine. MS Visual Studio is a gargantuan resource hog which won't be fun on your computer, and setting up console tools so that they work nicely is a PITA on Windows. linux has everything right out of the box.

1

u/ZulfiqarShadow Sep 05 '26

Which linux distribution will you recomend me? Iam not very familiar with them, also preferably one with graphical interface.

1

u/musbur Sep 05 '26

Any desktop operating system (as commonly understood) consists of a bootloader, the OS kernel, drivers and services, and the graphical user interface (GUI).

In Windows, all of this is rolled into one single distribution, without any choice of options. Which is why you pop in the install USB, and out pops a finished OS.

On Linux, you have multiple choices for any of these components. If you don't know which or why, this becomes confusing. Most people recommend Linux Mint for beginners. I've installed it once and it's pretty easy. Myself, I prefer Debian because it comes with a lot less clutter, but you have to make some minimal choices and understand them. The fact that you're looking to program in C shows a certain willingness to deal with IT stuff, so yes, I'd go with Debian. Make sure you have the installation instructions open on another device while you set up your PC.

1

u/ZulfiqarShadow Sep 05 '26

I much apreciate your help!

1

u/a4qbfb Sep 07 '26

Ubuntu or Mint.

1

u/EpochVanquisher Sep 05 '26

Ok, if you want to do it the hard way instead and you don’t mind taking the extra time to figure out how to set things up, you can find instructions online for how to set up GCC, Clang, or Visual C++ (the compiler). You will then want to install a build system too, like CMake. Then you need an editor with LSP, like VS Code. Finally, set up the compilation database for your project so that Clangd can work.

1

u/SignedInt32 Sep 07 '26

Just a question, why windows? (Linux offers all this by default) also someone is trying super hard to downvote you, very childish.

2

u/ZulfiqarShadow Sep 07 '26

I do not have much expirince with linux apart from when i was was in school we used one terminal based linux i think ubuntu. And the downvoting is becuse either becuse im not knowlagable on the subject and i have asked a stupjd question or becuse ive choosen to read a book on c instead of getting edjucated propertly (this is my guess atleast) i also dont speak english too well and maybe ive made some errors?

1

u/veloxVolpes Sep 05 '26

Code::blocks sounds like the right solution if your system is old, but if I were to recommend something to anyone searching for this info I'd give them this advice: If possible use Linux, it's really easy to compile and test Windows binaries on linux. If that isn't an option, treat WSL as your development environment, download all the tools you need in there, even your Windows compilers (mingw32-gcc). per my personal experience it's much simpler this way instead of using Msys2, or any of the Windows MinGW options (if you're setting it up yourself)

1

u/thisismyredaccount Sep 05 '26

Eclipse has a c/c++ distrubution that includes everything you need out of the box. It's actually a pretty great IDE for c, the debugger is fantastic.

If you want to use command line the easieat setup I know installing llvm from their website, they setup enviroment paths and all the unintuitive stuff you don't know about when you are new.

I recommend eclipse because the debugger interface will help you a lot while learning.

1

u/UnpaidCommenter Sep 05 '26

Check out Msys2.org. It lets you use the same GCC and Clang tools used on Linux.

1

u/septum-funk Sep 08 '26

eventually, look into how to use msys if you want to continue doing C dev work on windows. you're going to want that for C, using VS is bad advice for C as MSVC is a C++ compiler and only supports the C features necessary for C++

-1

u/Traveling-Techie Sep 05 '26

I prefer installing the tools from Cygnus.com, which has gcc, make, and shell tools (3 separate installations). It’s my first step on any new Windows system.

4

u/collectgarbage Sep 05 '26

I think you meant Cygwin.com