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
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!
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 at different stages.
Videos
07:50
How to Compile and Run C program Using GCC on Ubuntu 24.04 LTS ...
07:30
Compiling using GCC in Linux - YouTube
06:55
Shows how to use gcc to compile C code from within Windows ...
How to Compile and Run C program Using GCC Compiler ...
20:06
gcc 14.1 for C++23 - Compiling from source demonstration and ...
11:37
2.2(c) - Using the gcc Compiler - YouTube
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 › 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.
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 a simple C program using the gcc command, learning how to create a source file, compile it, and run the resulting executable.
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.
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.
GNU
gcc.gnu.org › onlinedocs › gcc-3.2.3 › 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.
The Geek Stuff
thegeekstuff.com › 2012 › 10 › gcc-compiler-options
15 Most Frequently Used GCC Compiler Command Line Options
October 30, 2012 - Through this option, output at all the stages of compilation is stored in the current directory. Please note that this option produces the executable also. ... So we see that all the intermediate files as well as the final executable was produced in the output. The option -l can be used to link with shared libraries. For example: ... The gcc command mentioned above links the code main.c with the shared library libCPPfile.so to produce the final executable ‘main’.
GNU
gcc.gnu.org › onlinedocs › gcc-3.2.2 › gcc › Invoking-GCC.html
GCC Command Options
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.
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.
CS Fundamentals
cs-fundamentals.com › c-programming › how-to-compile-c-program-using-gcc
gcc Compilation Process and Steps of C Program in Linux
This tutorial explains compilation ... preprocessing, compilation, assembly, and linking. Linux command to compile C program: gcc filename.c -o filename....
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 check if you have a compiler installed.
openEuler
docs.openeuler.org › en › docs › 22.03_LTS › docs › ApplicationDev › using-gcc-for-compilation.html
using-gcc-for-compilation | openEuler documentation | v22.03_LTS
GCC compilation command format: gcc [options] [filenames]
openEuler
docs.openeuler.org › en › docs › 20.09 › docs › ApplicationDev › using-gcc-for-compilation.html
using-gcc-for-compilation | openEuler documentation | v20.09
GCC compilation command format: gcc [options] [filenames]