TakeoffYoung

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

function library is divided into static library and dynamic library.


0x00. static function library

  • it was compiled into target file, so, its not needed at runtime.
  • Obviously, when the static library modified, you should recompile the application.
  • for example:

Makefile

hello: main.c libhello.a
gcc -o hello main.c -L. -lhello
libhello.a: hello.o
ar cr libhello.a hello.o
hello.o: hello.c
gcc -c hello.c
```

  • libhello.a removed or not does not make any difference on the running of "hello"

0x01. dynamic function library

  • create dynamic function library
gcc -shared -fPCI -o libhello.so hello.o

0x02.

posted on 2016-04-02 16:03  TakeoffYoung  阅读(157)  评论(0编辑  收藏  举报