*BSD News Article 29934


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!spool.mu.edu!news.cs.indiana.edu!sdd.hp.com!usc!cs.utexas.edu!not-for-mail
From: Clarence.Chu@f132.n700.z6.ftn.air.org (Clarence Chu)
Newsgroups: comp.os.386bsd.questions
Subject: How do I create shared libraries for FreeBSD?
Date: 1 May 1994 23:54:58 -0500
Organization: UTexas Mail-to-News Gateway
Lines: 26
Sender: daemon@cs.utexas.edu
Message-ID: <767854318.AA03564@f74.n700.z6.ftn.air.org>
NNTP-Posting-Host: cs.utexas.edu

TO: gusw
hi there,
 
how to create a shared library is documented in ld(1)!
 
follow the following to make a shared library:
 
1) compile the source with -fpic or -fPIC with -DPIC
2) load the *.o by "ld -dc -dp -Bshareable -o 
/usr/local/lib/libname.so.?.?
*.o
3) to test the shared library, link an executable with
   -lname, and show it by "ldd executable".  you'll see
   the size of executable is much smaller than it is being
   linked statically.
 
to my opinion, ld(1) is much comprehensive than those for linux.
 
oh, yes. make sure you are using FreeBSD-1.1-whatever for shared 
library.
 
enjoy,
 
clarence
...
 * Origin: BiG (since 87) - a BBS for programmers (6:700/132)