Path: utzoo!attcan!uunet!bywater!arnor!entwash.watson.ibm.com!wlm From: wlm@arnor.uucp Newsgroups: comp.unix.aix Subject: Re: Making shared libraries Message-ID: <1990Oct14.214547.9997@arnor.uucp> Date: 14 Oct 90 21:45:47 GMT References: <1990Oct11.160027@ead.dsa.com> Sender: news@arnor.uucp (NNTP News Poster) Reply-To: wlm@entwash.watson.ibm.com (Bill Moran) Organization: IBM TJ Watson Home for Tired Hackers Lines: 31 Well, I think there are several ways of doing what you want. First, shared things are looked for in /usr/lib and /lib (I forget the order), so if you put that lib in one of those places, the system will find it. Second, I seem to recall that there is something like LIBPATH looked for by the linker, and it looks in the places named. I don't recall whether you have to say: setenv LIBPATH /lib:/usr/lib:/a/aragorn/homes/aragorn1/src/X11R4-new/mit/new-lib/X or whether setenv LIBPATH /a/aragorn/homes/aragorn1/src/X11R4-new/mit/new-lib/X is sufficient. Third, at link time, you can do something like: cc -o ico -O ico.o /a/aragorn/homes/aragorn1/src/X11R4-new/mit/new-lib/X/shared.\ o -L/a/aragorn/homes/aragorn1/src/X11R4-new/mit/new-lib/X -lm where shared.o is a shared version of the R4 libX11.a. Using the -L flag puts info in the load header of the resulting executable which allows the loader to find the shared part when you try to run it. Finally, there probably is a #![...] directive for the export file, but I can't find the documentation for that stuff at the moment. I would suggest judicious use of -L. Bill Moran