正在加载...
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]

gcc 动态编译

[ 2011/10/03 17:24 | by selboo ]
gcc 动态编译(共享库)
  动态编译的可执行文件需要附带一个的动态链接库,在执行时,需要调用其对应动态链接库中的命令。
  
优点:体积小,编译快
缺点:依赖性高
This is The C Code
[root@74-82-173-217 shared]# cat add.c
int add (int x, int y) {
        return x + y;
}
Parsed in 0.004 seconds at 19.28 KB/s
add.c 求和函数
This is The C Code
[root@74-82-173-217 shared]# cat print.c
#include <stdio.h>
void print (int x) {
       printf ("%d\n",x);
}
Parsed in 0.006 seconds at 17.68 KB/s
print 打印函数
Tags: , ,

gcc 静态编译

[ 2011/10/01 19:32 | by selboo ]
gcc 静态编译
        就是在编译的时候把你所有的模块和库文件编译到一个可执行文件中,当你启动这个程序的时候所有模块和库加载到内存。加快程序执行效率,
优点:速度快,依赖性低
缺点:体积大,加载慢
This is The C Code
[root@74-82-173-217 static]# cat add.c
int add (int x, int y) {
        return x + y;
}
Parsed in 0.004 seconds at 20.39 KB/s
add.c 求和函数
This is The C Code
[root@74-82-173-217 static]# cat print.c
#include <stdio.h>
void print (int x) {
       printf ("%d\n",x);
}
Parsed in 0.005 seconds at 20.35 KB/s
print 打印函数
Tags: , ,
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]