Easiest way to set up C compiler on Windows 10 (if you use Visual Studio Code)?
assembly - How to compile C programs using cc command in cmd - Stack Overflow
Compiling C-code from the Command Prompt in Windows? - Stack Overflow
Windows 10 - Compile C++ in cmd - Stack Overflow
Videos
I've been learning C and playing around with it for a couple of months already.
I'm following CS50 course and first half of the course is almost entirely in C.
That being said, I only used their online codespaces so far, - and for my own personal practice, I used online complilers such as https://www.programiz.com/c-programming/online-compiler/
and https://www.onlinegdb.com/online_c_compiler .
This allowed me to focus on coding and not worry about compiling. I've made some stuff already, entirely using these tools.
However, now arrives the time that I need my own compiler on local machine.
The main reason is that I want to start practicing working with files on my own hard disk, and also using libraries outside of what these tools offer, such as conio.h.
I already tried to google how to set-up a compiler in Windows, but I've bumped into many hoops and obstacles and it's not (at least for me) as straightforward as it might seem.
So I'm asking you for help to set up my own coding environment for C in Windows, where I could compile the files (ideally with make too, and not just clang), where I could include external libraries, where I could work with files on my own HDD, etc... And ideally, where I could even turn these files into classical .exe files.
Thanks!
EDIT: Resolved:
Installing Visual Studio 2022 Community with included tools for C++, and then running Developer Command Prompt allowed me to compile C files by using command: cl filename.c which returns exe file, filename.exe . This exe file can be started by simply executing filename in command prompt or even from Windows by simply double clicking on its icon, like any other file. Thanks for all the responses, especially to RidderHaddock and _mutaz_ who gave me best directions.
You do this:
Copycl app.c
Here's a complete transcript, including setting up the environment for Visual Studio 2005 (change "8" to "9.0" for Visual Studio 2008).
CopyC:\src\tests>"\Program Files (x86)\Microsoft Visual Studio 8\vc\bin\vcvars32.bat"
Setting environment for using Microsoft Visual Studio 2005 x86 tools.
C:\src\tests>type app.c
#include <stdio.h>
int main(void)
{
printf("Hello world!\n");
return 0;
}
C:\src\tests>cl app.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
app.c
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
/out:app.exe
app.obj
C:\src\tests>app
Hello world!
MinGW provides a popular command-line GCC compiler for Windows.
i have very limited resources in my laptop (i3-10th gen). I want to run C programs, how to do that without any heavy software. I use VScode, i have installed python and it runs fine but i am struggling to run C.
i dont need something with too many features as i mainly learn P-Y-T-H_O-N now, but i would to be able to run a few of my older codes.
