From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,319de8257389ed52 X-Google-Attributes: gidfee84,public From: jonas@msiw30.msi.se (Jonas Hvarfner) Subject: Re: How to make shared libraries ? Date: 1995/07/21 Message-ID: <3unpur$4g8@news.kth.se>#1/1 X-Deja-AN: 106869384 references: <3ukf4i$903@uwm.edu> content-type: text/plain; charset=iso-8859-1 organization: Dept. of Atomic Physics, University of Stockholm, Sweden mime-version: 1.0 newsgroups: comp.unix.osf.osf1 In article <3ukf4i$903@uwm.edu>, T.C. Zhao 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