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
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › gcc-command-in-linux-with-examples
gcc command in Linux with examples - GeeksforGeeks
October 4, 2025 - The most important option required while compiling a source code file is the name of the source program, rest every argument is optional like a warning, debugging, linking libraries, object file etc. There are different options in gcc command to allow the user to stop the compilation process ...
🌐
Linux Man Pages
man7.org › linux › man-pages › man1 › gcc.1.html
gcc(1) - Linux manual page
If the -Q option appears on the command line before the --help= option, then the descriptive text displayed by --help= is changed. Instead of describing the displayed options, an indication is given as to whether the option is enabled, disabled or set to a specific value (assuming that the compiler knows this at the point where the --help= option is used). Here is a truncated example from the ARM port of gcc: % gcc -Q -mabi=2 --help=target -c The following options are target specific: -mabi= 2 -mabort-on-noreturn [disabled] -mapcs [disabled] The output is sensitive to the effects of previous c
🌐
GNU
gcc.gnu.org › onlinedocs › gcc-3.2 › gcc › Invoking-GCC.html
GCC Command Options - GCC, the GNU Compiler Collection
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.
🌐
UCLA Computer Science
web.cs.ucla.edu › classes › fall14 › cs143 › project › cpp › gcc-intro.html
Gcc tutorial
If, for instance, the above commands were used to create "myprog", and "file1.C" was subsequently modified, then the following commands would correctly update "myprog". g++ -c file1.C g++ file1.o file2.o -o myprog Note that file2.C does not need to be recompiled, so the time required to rebuild ...
🌐
RapidTables
rapidtables.com › code › linux › gcc.html
GCC C compiler
Compile myfile.c with optimization and link to output file execfile: $ gcc -O myfile.c -o execfile · cd · cp · ls · gcc -c · gcc -D · gcc -fPIC · gcc -g · gcc -I · gcc -L -l · gcc -o · gcc -O · gcc -Wall · cat command · cd command · cp command ·
Find elsewhere
🌐
GNU
gcc.gnu.org
GCC, the GNU Compiler Collection - GNU Project
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Objective-C++, Fortran, Ada, Go, D, Modula-2, COBOL, Rust, and Algol 68 as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system.
🌐
Stanford
web.stanford.edu › class › archive › cs › cs107 › cs107.1202 › resources › gcc
CS107 Compiling C Programs with GCC
This is just a quick overview on how to compile and run your own programs should you decide to do so without a Makefile. The simplest way to run gcc is to provide gcc a list of .c files: ... Note that you do not put header files (.h) into the gcc command: it reads in the header files as it compiles, based on the #include statements inside .c files.
🌐
LabEx
labex.io › tutorials › linux-linux-gcc-command-with-practical-examples-422697
Linux gcc Command with Practical Examples | LabEx
In this lab, you first learned the basics of the GCC (GNU Compiler Collection) compiler, including how to check the installed version and the common command-line options such as -c, -o, -g, -Wall, -Werror, and -O<n>. You then practiced compiling ...
🌐
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-3.3.5 › 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.
🌐
Scaler
scaler.com › home › topics › gcc command in linux
gcc Command in Linux - Scaler Topics
January 1, 2024 - The GCC command in Linux, which stands for GNU Compiler Collection, is an incredibly powerful tool used primarily for compiling and debugging programs written in C, C++, and other languages.
🌐
iO Flood
ioflood.com › blog › gcc-linux-command
GCC Command Guide: How-To Compile C Code in Linux
December 12, 2023 - This command compiles the ‘filename.c’ file and outputs an executable named ‘outputfile’. ... In this example, we use the gcc command to compile the ‘hello.c’ file. The -o option is used to specify the name of the output file.
🌐
Quora
quora.com › How-do-I-compile-a-C-program-using-a-GCC-compiler
How to compile a C program using a GCC compiler - Quora
Answer (1 of 4): Method 1 of 2:Using GCC for Linux 1. Open up a terminal window on your Linux system. Its icon usually is a black screen with some white characters on it. You can usually find it in your Applications menu. 2. Install GCC. If you do not have GCC already installed, you can use th...
🌐
GNU
gcc.gnu.org › onlinedocs › gcc-3.2.2 › gcc › Invoking-GCC.html
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.
🌐
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....
🌐
Reddit
reddit.com › r/c_programming › what is a great, well-written tutorial on the gcc command line parameters? (please don't say to read the 8,000+ page manual)
What is a great, well-written tutorial on the GCC command ...
December 30, 2018 - According to the published Rationale document for the C standard, the authors recognize that one of C's strengths lies in the ability of non-portable programs to perform actions which are not described by the Standard, but the gcc optimizer isn't designed to work reliably when not required to do so by its authors' interpretation of the Standard. ... Also you probably already know this but -c just compiles it into a .o, and -o sets the name of your executeable if you don't want it to be a.out
🌐
TutorialsPoint
tutorialspoint.com › unix_commands › gcc.htm
gcc Command in Linux
gcc stands for GNU Compiler Collection is a command used in Linux to compile programs written in C and C++ programming language. To compile a program, you simply type the gcc followed by the name of your default source file, like gcc program.c.