??????????????
????1>?????????????????????????????????-fpic???????????-shared??
????gcc -fpic  -c  add.c
????gcc -fpic  -c  sub.c
?????????м????add.o??sub.o
????2>???????????
????gcc  -shared –o  libtiger.so  add.o sub.o
????????????libtiger.so??libtiger.so????????????????????????????????main.c???????????г???
?????????
????????????????????????:
????gcc  -fpic   -shared add.c  sub.c  -o libtiger.so
????2.??????????
??????????????????????????????????μ?????”-l????”???????????????????????????????????
????1>???????
????gcc -o  main  main.c -L  ./  -ltiger
????2>-L????????????·????-ldtiger???????tiger??-ltiger?????????ù???Linux???μ??????????????lib*.so??????????????λ-l*??*????????????????
????3>??????????????′???
????error while loading shared libraries: libtiger.so: cannot open shared object file: No such file or direct
?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????2??С?
????4>??????·???????????????
????a. ??linux?·???????????????libtiger.so???? /lib ??(???????????????????????????sudo?????)?????????????г?????
????b.???????????????????????????????????·???У?????????·?????????????LD_LIBRARY_PATH??????
????export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
??????д??????????????????г???