|
[zd@localhost test1]$ vi print.c
[zd@localhost test1]$ gcc -fPIC -g -c -Wall print.c
[zd@localhost test1]$ gcc -shared -W1,soname,libmyprint.so.1 -o
libmyprint.so.1.0.1 print.o -lc
[zd@localhost test1]$ ldconfig -n ~/storage/program/test1
[zd@localhost test1]$ LD_LIBRARY_PATH=/home/zd/storage/program/test1
[zd@localhost test1]$ export LD_LIBRARY_PATH
[zd@localhost test1]$ ln -sf libmyprint.so.1.0.1 libmyprint.so.1
[zd@localhost test1]$ ln -sf libmyprint.so.1 libmyprint.so
[zd@localhost test1]$ vi print.h
[zd@localhost test1]$ vi myprint.c
[zd@localhost test1]$ gcc myprint.c -o myprint -L. -lmyprint
请问这里这里ldconfig在这里有什么作用?
还有为什么要建立两个符号连接?不是说是用soname找到相应的函数库的吗? |
|