[comp.windows.x] Help X11 MetaFont

drl@VUSE.VANDERBILT.EDU (David R. Linn) (11/11/90)

I'm trying to build MetaFont from the web2c-5.8a stuff with both SunView and
X11 support.  The executable I build doesn't work and dies with the message

ld.so: Undefined symbol: __XtInherit

Now, from reading this list, I understand  you will get this message if you
link against the Xt library when you don't need to.  Unfortunately, I know
(from nm) that I really do reference the Xt functions so I do need the Toolkit
librbary.

My order of libraries is "-lXt -lXext -lX11 -lsuntool -lsunwindow -lpixrect".
My X11 is MIT X11.4.11 built from the MIT sources and patches/fixes.
My current target (and compilation) machine is a Sun3 running SunOS4.1.

Can anyone suggest another reason for this error message?

	 David

David Linn, System Manager/Postmaster	   |INET: drl@vuse.vanderbilt.edu
Vanderbilt University School of Engineering|Phone: [+1] 615-343-6164
Post Office Box 3241, Station B            |Disclaimer:
Nashville, TN, USA  37235                  |  I speak only for myself.

drl@VUSE.VANDERBILT.EDU (11/14/90)

It seems I left out a crucial piece of information in my original
message:  I got the error while trying to build trapmf.

It seems that the windowing code is commented out during construction
of the TRAP version of MetaFont so I was, in fact, linking again
the toolkit when my program was not using the toolkit.  Doing so,
on a Sun, causes the error message I saw,

Moral:  If ld.so (under SunOS) tells yuou that __XtInherit is an
undefined symbol, you have probably linked against libXt when you
don't need to do so (even when you think you do).

	 David

bernward@xcc.uucp (Bernward Averwald) (11/16/90)

In article <9011101605.AA10287@signu.vuse> drl@VUSE.VANDERBILT.EDU (David R. Linn) writes:
>I'm trying to build MetaFont from the web2c-5.8a stuff with both SunView and
>X11 support.  The executable I build doesn't work and dies with the message
>
>ld.so: Undefined symbol: __XtInherit
...
>Can anyone suggest another reason for this error message?

The same happend to me just one day ago. 
Static linking (-Bstatic) "solves" the problem.

bernward

Bernward Averwald     X Computer Consult GmbH
                      Brandenburger Str. 2
		      D-4030 Ratingen Germany

yakker@ucrmath.ucr.edu (matt robinson) (11/18/90)

-> drl@VUSE.VANDERBILT.EDU (David R. Linn) writes:
-> I'm trying to build MetaFont from the web2c-5.8a stuff with both SunView and
-> X11 support.  The executable I build doesn't work and dies with the message
->
-> ld.so: Undefined symbol: __XtInherit
-> ...
-> Can anyone suggest another reason for this error message?


Well, if I'm not mistaken, and I have been MANY a time (grin), you might
want to try out compiling the program without the Xt/Xaw/Xmu libraries.
I tried compiling one of my programs by typing in:

	 cc -o myprog myprog.c -lXaw -lXt -lXmu -lX11 -O

and it worked without a hitch.  But then, when I ran it, I got the same
message you did:

	 ld.so: Undefined symbol: __XtInherit

When I went back and compiled the program with:

	 cc -o myprog myprog.c -lX11 -O

it worked just fine.   I wasn't using the Xt widgets, so I didn't need
the libraries.  Hope this works!

------------------------------------------------------------------------------
Matt D. Robinson                             "...If I only had a brain..."
yakker@ucrmath.ucr.edu                  -- The Scarecrow, The Wizard Of Oz
Systems Programming Group, UC Riverside
------------------------------------------------------------------------------

stolcke@icsib12.Berkeley.EDU (Andreas Stolcke) (11/18/90)

In article <1990Nov16.092941.9637@xcc.uucp> bernward@xcc.UUCP (Bernward Averwald) writes:
>In article <9011101605.AA10287@signu.vuse> drl@VUSE.VANDERBILT.EDU (David R. Linn) writes:
>>I'm trying to build MetaFont from the web2c-5.8a stuff with both SunView and
>>X11 support.  The executable I build doesn't work and dies with the message
>>
>>ld.so: Undefined symbol: __XtInherit
>...
>>Can anyone suggest another reason for this error message?
>
>The same happend to me just one day ago. 
>Static linking (-Bstatic) "solves" the problem.
>

No need for such a kludge (especially since this would increase your
binary size considerablay)!

The error typically occurs when you're linking with the shared Xt library
without ever actually using it in the program.  So either
 - try linking without -lXt
 - switch to using the X interface that actually uses libXt
   (METAFONT has two, one Xlib-based, the other Xt-based. the latter is
   recommended).

Andreas Stolcke
International Computer Science Institute	stolcke@icsi.Berkeley.EDU
1957 Center St., Suite 600, Berkeley, CA 94704	(415) 642-4274 ext. 126