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 ...
🌐
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.
🌐
GNU
gcc.gnu.org › onlinedocs › gcc › Invoking-GCC.html
Invoking GCC (Using the GNU Compiler Collection (GCC))
The usual way to run GCC is to run the executable called gcc, or machine-gcc when cross-compiling, or machine-gcc-version to run a specific version of GCC. When you compile C++ programs, you should invoke GCC as g++ instead.
🌐
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
🌐
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 ...
🌐
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.
🌐
The Geek Stuff
thegeekstuff.com › 2012 › 10 › gcc-compiler-options
15 Most Frequently Used GCC Compiler Command Line Options
October 30, 2012 - The compiler option -D can be used to define the macro MY_MACRO from command line. $ gcc -Wall -DMY_MACRO main.c -o main $ ./main Macro defined The Geek Stuff [-10]
Find elsewhere
🌐
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.
🌐
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 ·
🌐
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-8.2.0 › gcc › Invoking-GCC.html
3 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. Then the output consists of object files output by the assembler.
🌐
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.
🌐
Hexmos
hexmos.com › freedevtools › c › cmd › gcc
GCC Compiler - Command Line Compilation Guide Cheatsheet | cmd Reference | Online Free DevTools
By default, GCC creates an executable file named a.out. ... You can specify a custom name for your output executable using the -o flag. # To compile a file with a custom output: gcc -o myprogram file.c
🌐
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 ...
🌐
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.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 9 › html › user_guide › chap-gcc
Chapter 2. GNU Compiler Collection (GCC) | User Guide | Red Hat Developer Toolset | 9 | Red Hat Documentation
When you are working on a project ... the entire project. To compile an object file on the command line,: $ scl enable devtoolset-9 'gcc -o object_file -c source_file'...
🌐
Ticalc
tigcc.ticalc.org › doc › comopts.html
GCC Command-Line Options
This option is not needed by the compiler because it is always quiet, but the linker and especially the assembler output some information. ... This switch is an addition to the '-v' switch. It tells TIGCC to output only the commands that are run directly. This was the default in some previous releases. ... The '-g' switch in GCC turns on debugging information in the preferred format for the target.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › linux tutorial › gcc command in linux
GCC Command in Linux | Learn GCC Options in Linux Environment
March 20, 2023 - The command –v is used as below: ... Here in this article, we came to know about how to Write a C Program in Linux, Compile the C Program and Run the c Program. GCC is very easy to use and has given us many options to simplify or run the C Program in Linux OS.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai