gcc -共享选项标志

gcc -shared 为共享库生成共享对象文件。

句法

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

例子???

我的文件.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 •°