On Thu, Jun 25, 1998 at 03:26:29PM -0400, Bruce Tong wrote:
> I can find all sorts of information about using libraries contained in
> /usr/lib and /lib, but how do you create them? Can I just compile code
> into an object file and name it foo.a, or is there more to it than that?
To make a library for static linking (a '.a' file) just use the 'ar'
command. See its man page "man ar".
As a brief example, given two object files:
foo.o
bar.o
make a library "foobar.a" by doing:
ar rv foobar.a foo.o bar.o
adds to an existing library (replacing the old members of the same name),
while:
ar cv foobar.a foo.o bar.o
tells ar to create a new one, assuming it does not already exist.
There are a number of useful options, see the man page.
Shared libraries are a different matter,... I don't happen to have memorized
the procedure but do recall having found it in the online docs once when
I did need to know. Likely someone else here can tell you the way to do it
if you need, also.
Fred
--
---- Fred Smith -- [EMAIL PROTECTED] ----------------------------
"For the word of God is living and active. Sharper than any double-edged
sword, it penetrates even to dividing soul and spirit, joints and marrow;
it judges the thoughts and attitudes of the heart."
---------------------------- Hebrews 4:12 (niv) ------------------------------
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject.