Marcador d'opció gcc -fPIC

gcc -fPIC genera codi independent de la posició (PIC) per a biblioteques compartides.

Sintaxi

$ gcc -fPIC [options] [source files] [object files] -o output file

 

Utilitzeu -fpic en comptes de -fPIC per generar codi més eficient, si és compatible amb el compilador de la plataforma.

Exemple

Escriu el fitxer font myfile.c :

// myfile.c
#include <stdio.h>
 
int myfunc()
{
    printf("myfunc\n");
}

 

Build myfile.c genera myfile.o :

$ gcc -fPIC -c myfile.c
$

 


Vegeu també

Advertising

GCC
°• CmtoInchesConvert.com •°