[so] creare shared library
Ruxi Jitianu
so@atlantis.cs.pub.ro
Sun, 23 Nov 2003 18:26:54 +0200
Buna!
As vrea sa ma lamureasca si pe mine cineva de ce obtin urmataore eroare
daca incerc sa crez shared library de care avem nevoie.Am urmat exemplul
cu libhello din Program Library HOWTO.
[root@ruxi tema3]# gcc -fPIC -Wall -g -c libmonitor1.c
[root@ruxi tema3]# gcc -g -shared -Wl,-soname,libmonitor1.so.0 -o libmonitor1.so.0.0 libmonitor1.o -lc
[root@ruxi tema3]# /sbin/ldconfig -n .
[root@ruxi tema3]# ln -sf libmonitor1.so.0 libmonitor1.so
[root@ruxi tema3]# gcc -Wall -g -c rw.c -o rw.o
[root@ruxi tema3]# gcc -Wall -c rw.c -o rw.o -L. -lmonitor1
gcc: -lmonitor1: linker input file unused since linking not done
p.s.
nu am mai copiat libmonitor1.so.0.0 in vreun /usr/local/lib pt ca vreau sa fie in directorul curent,
asa ca fac chestia aia cu /sbin/ldconfig -n .