gcc -shared ģenerē koplietojamo objektu failu koplietojamai bibliotēkai.
$ gcc -shared [options] [source files] [object files] [-o output file]
myfile.c :
// myfile.c
#include <stdio.h/
int main()
{
printf("Program run!\n");
int i=10;
}
Regulāra myfile.c būvēšana nesniedz ziņojumus:
$ gcc myfile.c -o myfile
$
Veidot un myfile.c ar -Wall:
$ gcc -Wall myfile.c -o myfile
myfile.c In function 'main':
myfile.c:6:6: warning: unused variable 'i'
myfile.c:7:1: warning: control reaches end of non-void function
$