Path: utzoo!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think!snorkelwacker!bloom-beacon!ssiwest.UUCP!quenelle From: quenelle@ssiwest.UUCP (Chris Quenelle) Newsgroups: comp.windows.x Subject: (none) Message-ID: <9005291632.AA06491@ssiwest.com> Date: 29 May 90 16:32:13 GMT Article-I.D.: ssiwest.9005291632.AA06491 Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 54 Subject: Re: LD_LIBRARY_PATH woes WARNING: Much of what you are about to read could be regarded as a flame. If you have a sensitive disposition, you may want to skip this posting. > Just copy the OpenWindows dynamic libraries into /usr/lib ... This was one of the things I wanted to avoid. Due to the fact that we have several file servers, several network servers and workstations on three sub-nets, copying the libraries into /usr/lib would not only take up a lot of extra space, but it would also be very hard to maintain when we upgraded OS versions etc. > The secret is the loader's use > of major and minor version numbers. The major version of the library that > gets loaded must match the major version the program was compiled with. The > loader uses the highest minor version available. The MIT libraries are > major version 4, and the OpenWindows libraries are major version 0. In some perhaps-as-yet-unreleased version of OpenWindows which may-or-may-not exist somewhere, but which we have, the release comes with symbolic links for libraries with a major version number of 4 for libXt and libX, the same as the MIT released X version numbers. This means that in order to run an OW tool with OW libraries, the OpenWindows directory has to be FIRST in your LD_LIBRARY_PATH and in order to run an MIT X tool with the MIT X libraries, the MIT directory has to be FIRST in your LD_LIBRARY_PATH. I've recently run into a problem with xterm giving me a segmentation violation when it was compiled with MIT X, but dynamically linked with OW libX/libXt. This is evidence to me that it is important to get the right one. > So when you run a program, everything works fine since > the OpenWindows program were compiled with version 0 libraries and the > MIT programs with version 4. The only possible gotcha is when you want to > compile a program to use the OpenWindows libraries, you have to use > (for example) -lX11.0 instead of -lX11. Which means that after using imake, you have to go in and modify the Makefiles by hand ? Yuck. > Take a look at the manual pages ld(1) and ldd(1) I've read the man pages, and also the manual section on using Shared Libraries. It's a very complicated mechanism, and, in my opinion, not thought out enough to be flexible. --chris @---@ Chris Quenelle ( X-Rat ) (415) 373-8023 \|/ Supercomputer \.X./ ...!uunet!ssi!quenelle -+-----Systems----- \ / ssiwest!quenelle@lll-lcc.llnl.gov /|\ Inc. ==o== Nothing the God of Bio-Mechanics wouldn't let you in heaven for ?