gcc Command Examples

Preprocess and compile C and C++ source files, then assemble and link them together. More information: https://gcc.gnu.org.

gcc {{path/to/source1.c path/to/source2.c ...}} -o {{path/to/output_executable}}

gcc {{path/to/source.c}} -Wall -g -Og -o {{path/to/output_executable}}

gcc {{path/to/source.c}} -o {{path/to/output_executable}} -I{{path/to/header}} -L{{path/to/library}} -l{{library_name}}

gcc -S {{path/to/source.c}}

gcc -c {{path/to/source.c}}

gcc {{path/to/source.c}} -O{{1|2|3|fast}} -o {{path/to/output_executable}}