Ang gcc -fPIC ay bumubuo ng position independent code (PIC) para sa mga shared library.
$ gcc -fPIC [options] [source files] [object files] -o output file
Gamitin ang -fpic sa halip na -fPIC upang makabuo ng mas mahusay na code, kung sinusuportahan ng platform compiler.
Sumulat ng source file myfile.c :
// myfile.c
#include <stdio.h>
int
myfunc()
{
printf("myfunc\n");
}
Bumubuo ng myfile.c ang myfile.o :
$ gcc -fPIC -c myfile.c
$
Advertising