How to compile a C program

‮h‬ttps://www.lautturi.com
How to compile a C program

It is recommended to use the IDE for C programming and compilation.
If you want to compile using the command line,
We can refer to the compilation content of the IDE,
For example:

-------------- Build: Debug in hello (compiler: GNU GCC Compiler)---------------

gcc.exe -Wall -g  -c F:\hello\main.c -o obj\Debug\main.o
gcc.exe  -o bin\Debug\hello.exe obj\Debug\main.o   
Output file is bin\Debug\hello.exe with size 53.93 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

As you can see,

gcc.exe -Wall -g  -c F:\hello\main.c -o obj\Debug\main.o
gcc.exe  -o bin\Debug\hello.exe obj\Debug\main.o

These two commands are the compile commands.
The final output file is :hello.exe

Created Time:2017-08-28 14:58:33  Author:lautturi