From: jonas@msiw30.msi.se (Jonas Hvarfner)
Subject: Re: How to make shared libraries ?
Date: 1995/07/21 [thread overview]
Message-ID: <3unpur$4g8@news.kth.se> (raw)
In-Reply-To: 3ukf4i$903@uwm.edu
In article <3ukf4i$903@uwm.edu>, T.C. Zhao <zhao@bloch.phys.uwm.edu> wrote:
>Wondering how to make a shared library. [ stuff deleted... ]
The following example shows how to make libXpm.so. Also check the information
given in the file /usr/shlib/so_locations.
ld -check_registry /usr/shlib/so_locations -shared -all \
-o libXpm.so *.o -none -lX11 -lc
ALL objects after -all is put in the .so-file, even if they are not needed.
-none switches of -all and only objects needed to resolve references are
ar added.
-check-registry can be omitted. Instead you can (but don't need to) copy
/usr/shlib/so_locations to ./ (where you have your *.o) and link without
-check_registry. ./so_locations will be checked and updated automatically.
(See the comments in /usr/shlib/so_locations.)
If your library is going to be put somewere else then in the standard
directories, i.e. /usr/shlib, you should add -soname /full/path/to/libname.so
(see loader(5)) in the ld-command above. Otherwise you'll have to link
with -rpath.
Hope this helps!
Regards,
Jonas
--
Jonas Hvarfner Dept. of Atomic Physics
hvarfner@msi.sunet.se University of Stockholm
next prev parent reply other threads:[~1995-07-21 4:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-07-20 4:00 How to make shared libraries ? T.C. Zhao
1995-07-21 4:00 ` Jonas Hvarfner [this message]
1995-07-25 4:00 ` George Chaltas
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox