HomeCodeLinuxgcc -c option flag
Linux commands

gcc -c option flag

gcc -c compiles source files without linking.

gcc -c compiles source files without linking.

Syntax

$ gcc -c [options] [source files]

Example

Write source file myfile.c:

// myfile.c#include  void main(){    printf("Program run\n");}

Compile myfile.c:

$ gcc -c myfile.c

This compilation generated myfile.o object file.