gcc -shared ਵਿਕਲਪ ਫਲੈਗ

gcc -shared ਸ਼ੇਅਰਡ ਲਾਇਬ੍ਰੇਰੀ ਲਈ ਸ਼ੇਅਰਡ ਆਬਜੈਕਟ ਫਾਈਲ ਤਿਆਰ ਕਰਦਾ ਹੈ।

ਸੰਟੈਕਸ

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

 

myfile.c ਦਾ ਨਿਯਮਤ ਬਿਲਡਕੋਈ ਸੰਦੇਸ਼ ਨਹੀਂ ਦਿੰਦਾ:

$ gcc myfile.c -o myfile
$

 

-Wall ਨਾਲ myfile.c ਦਾ ਬਿਲਡ:

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

 


ਇਹ ਵੀ ਵੇਖੋ

Advertising

ਜੀ.ਸੀ.ਸੀ
°• CmtoInchesConvert.com •°