Newsgroups: comp.windows.x
Path: utzoo!utgpu!watserv1!watdragon!jmsellens
From: jmsellens@watdragon.waterloo.edu (John M. Sellens)
Subject: Sun shared libs - openwin vs MIT R4
Message-ID: <1991May8.210941.4846@watdragon.waterloo.edu>
Organization: Not the DCS Secret Police
Date: Wed, 8 May 1991 21:09:41 GMT
Lines: 35

Sun, in their wisdom, forces OpenWindows users to set LD_LIBRARY_PATH
in order to find the shared libraries in /usr/openwin/lib, instead of
putting them somewhere normal, like /usr/lib for example, or using an
appropriate -L on the cc command line when they link the applications.

I have the MIT shared libraries somewhere else (doesn't really matter where).
I'm having trouble convincing my MIT binaries to ignore LD_LIBRARY_PATH,
and use the library paths that I gave them when I linked them.  I checked
the FAQ, but it didn't seem to answer this question.

Ordinarily, I'll compile with something like
  cc -o blah blah.c -L/software/x11/lib -lX11
to which ldd replies
  % ldd blah
	  -lX11.4 => /software/x11/lib/libX11.so.4.2
	  -lc.1 => /usr/lib/libc.so.1.6.1
As it should.  But if LD_LIBRARY_PATH is set, it gets searched first,
rather than using the libraries I used when I linked.  Which of course
generates a lot of complaints from Xt
    Warning: Widget class VendorShell version mismatch (recompilation needed):
      widget 11004 vs. intrinsics 11003.
(7 of these from xdvi for example), since it ends up using the Sun libraries,
rather than my nice up to date MIT libraries that I used in the first place.

I've tried all the combinations of cc arguments that I can think of,
to no avail.

Has anyone else run into this problem, and does anyone have a solution
to this, other than beating Sun over the head for being silly?

Thanks very much for any help.

John Sellens
U of Waterloo
jmsellens@watdragon.waterloo.edu
