gcc -shared option flag

A gcc -shared megosztott objektumfájlt generál a megosztott könyvtárhoz.

Szintaxis

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

Példa???

myfile.c :

// myfile.c
#include <stdio.h/

int main()
{
    printf("Program run!\n");
    int i=10;
}

 

A myfile.c rendszeres összeállítása nem ad üzenetet:

$ gcc myfile.c -o myfile
$

 

A myfile.c összeállítása a -Wall segítségével:

$ 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
$

 


Lásd még

Advertising

ÖET
GYORS TÁBLÁZATOK