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
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 ...
Top answer 1 of 4
23
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
2 of 4
2
I would suggest you go through this compilation instruction :-
gcc -o test.exe test.c
I believe this code runs perfectly on your windows system.Please inform if it doesn't!
Videos
07:50
How to Compile and Run C program Using GCC on Ubuntu 24.04 LTS ...
11:37
2.2(c) - Using the gcc Compiler - YouTube
How to Compile and Run C program Using GCC Compiler ...
07:30
Compiling using GCC in Linux - YouTube
00:20
How to Use the `gcc` (Compile C Programs) Command in Linux! (Quick ...
01:45
Linux System Programming in under 3 minutes: The gcc compiler - ...
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
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]
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.
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".
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 ·
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.
Call +917738666252
Address Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai