From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3b4188d9f2b79641 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-02-28 10:41:09 PST Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!zombie.ncsc.mil!news.duke.edu!convex!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!mrnews.mro.dec.com!news From: George Chaltas Newsgroups: comp.unix.osf.osf1 Subject: Re: How to make a shared library Date: 28 Feb 1995 16:28:58 GMT Organization: Digital Equipment Corporation - Marlboro, MA Message-ID: <3ivj0a$7i6@mrnews.mro.dec.com> References: <3iqblv$4ik@info.epfl.ch> NNTP-Posting-Host: darkwing.mro.dec.com "Stefan Monnier" wrote: > > I looked in the ld manpage and such but could quite understand how to make a .so > library. I'm probably dense but still... > > Anyboy could tell me what command to use instaed of 'ar rv' ? > > > Stefan Sure -- as you suspected, you use ld(1) to create shared libraries. The manual will give you all the gory details, but here are some simple examples: Example 1 - create a shared library from two object files: ld -o mylib.so obj1.o obj2.o -shared Example 2 - create a shared library from an archive: ld -o mylib.so -all myarchive.a -shared The -all flag tells the linker to incorporate all the modules in the following archive, rather than just using those modules necessary to resolve previously referenced symbols. In example 2 (above), if the -all flag were ommitted you'd end up with an empty shared library. For more than you ever wanted to know about shared libraries, see section 3 of the "DEC OSF/1 Programmer's Guide", which is on the Operating System distribution CD. Section 3.5 deals specifically with creating shared libraries. George Chaltas Digital Equipment Corporation