gcc — GNU C Compiler Basics

gcc is the GNU C compiler. It is commonly used to compile C programs on Linux and is often required when building software from source.

Compile a simple C file

gcc hello.c -o hello

Run the compiled program

./hello

Show warnings while compiling

gcc -Wall hello.c -o hello

For larger projects, prefer the project’s documented build process, such as make, cmake or package-specific instructions.

Leave a Comment