Try to compile your code normally as

gcc test.c

If you get default output file a.exe,then go for

gcc test.c -o test.exe

Answer from Sathish on Stack Overflow
🌐
Wikihow
wikihow.com › computers and electronics › software › programming › c programming languages › how to compile a c program using the gnu compiler (gcc)
How to Compile a C Program Using the GNU Compiler (GCC)
February 19, 2026 - On Windows 10 and 11, you can use ... a C program from source code using GCC. To make sure GCC is installed, run the command gcc --version....
Discussions

How to run (and compile) a C file with arguments with gcc? - Stack Overflow
I think it's a very simple question but I have less experience with command line. I have an old C program I want to run. It shows the following text: /* This is a stand-alone program intended... More on stackoverflow.com
🌐 stackoverflow.com
why do i need to use gcc -Wall
GCC has a variety of options beginning with -W that enable warnings. Warnings are where the compiler tells you about code that is technically valid, but that is probably not what you actually meant. C is full of foot-guns, and having warnings enabled will help you avoid them. It seems like half the time I'm helping somebody out on this subreddit I start off with "enable warnings in your compiler — it will point out the bug in your code". -Wall specifically means to enable warnings for "constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros". It's a good baseline set of warning categories, and there's very little reason not to enable them. Once upon a time this option actually did turn on all warnings, hence the name, but nowadays there are many more categories available than what -Wall will give you. -Wall can't really be expanded to include them because some of them aren't particularly useful, or they warn about things that aren't likely to be problems, or because it would break things for people or programs that treat compilation warnings as errors. More on reddit.com
🌐 r/C_Programming
22
20
March 31, 2022
How to run C in windows
This is not a language problem, rather an IDE problem. I know VSCode has pretty bad support for C, and Visual Studio is quite massive, so that probably wouldn't work. Code::Blocks is a very lightweight IDE for C and C++, you could try that. More on reddit.com
🌐 r/C_Programming
22
1
August 19, 2021
I’m trying to run a C program in Visual Studio Code on Windows, but I’m facing two errors: (1) The terminal says 'gcc' is not recognized as an internal or external command, and (2) #include <stdio.h> is underlined with the error cannot open source file "stdio.h". How do I fix these issues and set up
Follow the instructions in C/C++ for Visual Studio Code to "Set up your C++ Environment". More on reddit.com
🌐 r/C_Programming
12
1
December 20, 2024
🌐
Stanford
web.stanford.edu › class › archive › cs › cs107 › cs107.1194 › resources › gcc
CS107 Compiling C Programs with GCC
If the program compiled without errors or warnings, you don't get any output from gcc, and you will have a new file in your directory, called a.out. To run this file, you need to tell the shell to run the file in the current directory, by using ./ before the name:
🌐
Edureka
edureka.co › blog › how-to-compile-c-program-in-command-prompt
How to Compile & Run a C Program in Command Prompt?
July 23, 2024 - The command prompt has a set of steps we need to perform in order to execute our program without using a GUI compiler. In this article, we will understand how to compile and Run a C program in the command prompt. ... Run the command ‘gcc -v’ to ...
🌐
Medium
medium.com › @laura.derohan › compiling-c-files-with-gcc-step-by-step-8e78318052
Compiling C files with gcc, step by step | by Laura Roudge | Medium
February 16, 2019 - So once we compiled it, if we run this program we will only see the phrase “Hello, World” appearing. In order for our main.c code to be executable, we need to enter the command “gcc main.c”, and the compiling process will go through ...
🌐
GNU
gcc.gnu.org › onlinedocs › gcc › Invoking-GCC.html
Invoking GCC (Using the GNU Compiler Collection (GCC))
When you invoke GCC, it normally does preprocessing, compilation, assembly and linking. The “overall options” allow you to stop this process at an intermediate stage. For example, the -c option says not to run the linker. Then the output consists of object files output by the assembler.
🌐
Medium
salmenzouari.medium.com › how-to-compile-and-run-c-program-in-linux-using-gcc-b58ab78a5f53
How to Compile and Run C Program in Linux Using gcc? | by Salmen Zouari | Medium
September 18, 2019 - For you, there is no need to type the complex ld command directly - the entire linking process is handled transparently by gcc when invoked, as follows. ... During the whole compilation process there are other files also in role along with the source code file. If you see the very first statement of helloworld.c it is #include <stdio.h> (includes header file). Likewise, while compiling a C program you have to work with following types of files.
Find elsewhere
🌐
Log2Base2
log2base2.com › C › basic › how-to-compile-the-c-program.html
How to compile c program in linux using gcc
2.vim file.c (file name can be ... button and then type :wq. It will save the file. To compile the program: Type, 5.gcc file.c · To Run the program: Type, 6....
🌐
NTU
www3.ntu.edu.sg › home › ehchua › programming › cpp › gcc_make.html
GCC and Make - A Tutorial on how to compile, link and build C/C++ applications
The rule "hello.exe" then run its command "gcc -o hello.exe hello.o". Finally, the rule "all" does nothing. More importantly, if the pre-requisite is not newer than than target, the command will not be run. In other words, the command will be run only if the target is out-dated compared with ...
🌐
EmbedJournal
embedjournal.com › compiling-c-programs-using-gcc
Compiling C Programs Using GCC - EmbedJournal
April 1, 2017 - Here is how to specify the output file name during compilation and execute it likewise, $ gcc filename.c -o executable.file $ ./executable.file · Most people have a feeling that if the program runs they don’t have to worry about the warnings it may throw. Warnings are given for a reason and play a vital role.
🌐
LinkedIn
linkedin.com › pulse › compiling-c-program-gcc-cesar-molina-salas
Compiling a C program with gcc
September 30, 2021 - vagrant@vagrant-ubuntu-trusty-64:~$ gcc -o main main.c vagrant@vagrant-ubuntu-trusty-64:~$ ls main main.c vagrant@vagrant-ubuntu-trusty-64:~$ To run the main program, we type “./main” into the terminal.
🌐
Christopher Siu
users.csc.calpoly.edu › ~phatalsk › references › howToCompileAndRunCProgramsFromCommandLine.html
How To Compile and Run C Programs From the Command Line
For example, assumming you have mySource1.c, mySource2.c, and mySource3.c, the command to compile them into a single program would be: gcc -ansi pedantic -Wall -Werror -lm mySource1.c mySource2.c mySource3.c · If you have compiler errors you must fix them now.
🌐
Swarthmore College
cs.swarthmore.edu › ~newhall › unixhelp › gccbasics.html
Basic compiling and running C programs on our system
% gcc -g -Wall -o add add.c # to run: % ./add -lm to link in the math library (it contains functions like sqrt, cos, sin, etc): ... Eventually, you will want to put the compilation commands in a makefile and then just run the command make to compile your program.
🌐
Tildesites
tildesites.bowdoin.edu › ~ltoma › teaching › cs3225-GIS › fall17 › Lectures › basics.html
Compiling and running a C program from the terminal
[ltoma@dover:~/cs3225/startup]$ gcc -g -Wall hello.c -o hello [ltoma@dover:~/cs3225/startup]$ If for whatever reason you prefer to work locally on your laptop or desktop: open a new terminal window and keep this window open right next to the window where you are logged in to dover.
🌐
Medium
steffanynaranjo.medium.com › how-to-compile-c-files-with-gcc-step-by-step-5939ab8a6c47
How to compile C files with gcc, step by step. | by Steffany Naranjo Vargas | Medium
June 11, 2020 - The above command will generate helloworld.o as it is specified with -o option. And, the resulting file contains the machine instructions for the classic "Hello World!" program, with an undefined reference to printf. This is the final stage in compilation of “Hello World!” program. This phase links object files to produce final executable file. An executable file requires many external resources (system functions, C run-time libraries etc.).
🌐
CODE FARM
blog.codefarm.me › compile-and-run-c-program-in-linux-using-gcc
Compile and Run C Program in Linux Using GCC | CODE FARM
March 14, 2017 - You may note the assembly code conatins a call to the external function printf (or puts on gcc version 8.3.0). Here, the assembler (as) translates hello.s into machine language instructions, and generates an object file hello.o. You can invoke the assembler at your own by executing the following command. ... The above command will generate hello.o as it is specified with -o option. And, the resulting file contains the machine instructions for classic “Hello World!” program, with an undefined reference to printf.
🌐
iO Flood
ioflood.com › blog › gcc-linux-command
GCC Command Guide: How-To Compile C Code in Linux
December 12, 2023 - The -g flag allows you to generate debug information for use with GDB, the GNU Debugger. gcc -g hello.c -o hello # Output: # Creates an executable file named 'hello' with debug information.
🌐
San Diego State University
ost.sdsu.edu › kb › faq.php
Engineering Help Desk
By default, gcc places the executable into this file, overwriting any existing file of the same name. You specify the name of your executable, say samplePrgoram by the following line: gcc sampleProgram.c -o sampleProgram · The final step is to run the compiled C program.