[comp.windows.x] gcc 1.37.1, library path confusion on X11 R4 fix 18

felix@ai.sri.com (Francois Felix INGRAND) (10/04/90)

After applying fix-15-18 to X11 R4, I have the following problem:

gcc version 1.37.1, sun 3 os 4.0.3

making .././fonts/mkfontdir
rm -f mkfontdir
gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -o mkfontdir mkfontdir.o fontdir.o snf_
util.o -O  -Bstatic -L../.././lib/Xmu -lXmu -Bdynamic
ld: /usr/local/lib/libXmu.sa.4.0: warning: table of contents for archive is out of date; reu
n ranlib(1)
ld: Undefined symbol
   _applicationShellWidgetClass
   _wmShellWidgetClass
*** Error code 1
make: Warning: Target `all' not remade because of errors
Current working directory /tmp_mnt/home/cay1/X11/sun3/mit/fonts/mkfontdir

(Xmu is "outdated" because I cp it to install it, butthis should not be a
problem, nevertheless, it shows that is is looking to the wrong library)

But if I do:
cc -o mkfontdir mkfontdir.o fontdir.o snf_util.o -O -Bstatic
-L../.././lib/Xmu -lXmu
It works

I have the feeling that the library Xmu has been modified by the patch (they
added _applicationShellWidgetClass  _wmShellWidgetClass), and gcc is trying to
use the installed library (in /usr/local/lib) instead of the one in the X11
tree.

I could probably fix this problem by installing the lib and then recompiling
it, but may be I am overlooking something.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Francois Felix INGRAND                          SRI International, AIC
felix@AI.SRI.COM                                333, Ravenswood Avenue
(415) 859-5584                                  MENLO PARK, CA 94025, USA
"Read my Lisp... No new syntax" (nil)

moss@brl.mil (Gary S. Moss (VLD/VMB) <moss>) (10/04/90)

In article <FELIX.90Oct3100123@cayucos.ai.sri.com>, felix@ai.sri.com (Francois Felix INGRAND) writes:
|> 
|> After applying fix-15-18 to X11 R4, I have the following problem:
|> 
|> gcc version 1.37.1, sun 3 os 4.0.3
|> 
|> making .././fonts/mkfontdir
|> rm -f mkfontdir
|> gcc -DNOSTDHDRS -fstrength-reduce -fpcc-struct-return -o mkfontdir mkfontdir.o fontdir.o snf_
|> util.o -O  -Bstatic -L../.././lib/Xmu -lXmu -Bdynamic
|> ld: /usr/local/lib/libXmu.sa.4.0: warning: table of contents for archive is out of date; reu
|> n ranlib(1)
|> ld: Undefined symbol
|>    _applicationShellWidgetClass
|>    _wmShellWidgetClass
|> *** Error code 1
Unless it has changed since gcc 1.36, the flag you want is "-static" rather
than "-Bstatic", check the gcc manual page.  That explains why it is linking
with /usr/local/lib/libXmu.sa.4.0.

I got burnt by this one myself :-{
-Gary