Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!tcdcs!swift.cs.tcd.ie!maths.tcd.ie!jorice From: jorice@maths.tcd.ie (Jonathan Rice) Newsgroups: comp.windows.x Subject: Re: Can't fine XtInherit Message-ID: <1990Jun27.165544.4413@maths.tcd.ie> Date: 27 Jun 90 16:55:44 GMT References: <7557@ccncsu.ColoState.EDU> Organization: Dept. of Maths, Trinity College, Dublin, Ireland. Lines: 45 In <7557@ccncsu.ColoState.EDU> thorson@typhoon.atmos.colostate.edu (Bill Thorson) writes: >I am trying to build Metafont with the X11 interface. The problem I >am running into is that it is looking for XtInherit and can't find >it. Can anyone tell me what library that can be found in? I've had a similar but possibly unrelated problem. First of all, by "XtInherit" I take it that you mean the _XtInherit procedure, which is used as the test value to determine if a widget class inherits a widget field value from its superclass or not. This is described on Page 21 of the X11R4 X Toolkit Intrinsics manual. The procedure is defined in mit/lib/Xt/Initialize.c and is eventually built into the Xt library libXt.a. Now to my problem, which has to do with the _XtInherit beastie and SunOS shared libraries. I'm using SunOS 4.0.3 on a Sparcstation1 and gcc 1.36. I'm running X11R4 and using the Athena widget set, both of which were compiled using cc. SYMPTOM: At run-time, ld.so complains ld.so: Undefined symbol: __XtInherit If I use static libXt.a, no problems. Links fine. Now, from a cursory inspection of the X source, it seems that this is to do with some tricking around with names so that _XtInherit has a consistent value throughout all shared copies. _XtInherit is one of several routines which have static stub versions defined for them in mit/lib/Xt/sharedlib.c. When using the value of _XtInherit, you therefore get this single static value. When *calling* _XtInherit, however, the stub routine in turn calls the original (now shared) version which has been renamed to __XtInherit by a #define, which carries out the original error-printing function. That's the way it *should* work, as far as I can see. So why can't ld.so find the shared version? Here's what I get when I run nm on shared and static versions of Xt to see what's actually there: libXt.a:Initialize.o:0000002c T __XtInherit libXt.sa.4.0:sharedlib.o:00000000 T __XtInherit libXt.sa.4.0:sharedlib.o: U ___XtInherit libXt.so.4.0:0000c19c T ___XtInherit That *looks* correct to me. Any suggestions? *------------------------------------------------------------------------------* | Jonathan Rice | Email: jorice@cs.tcd.ie | He was a common fly | |------------------------| Tel.: (01) 772941 x2156 | With a taste for fashion | | Computer Science Dept. | Fax: (01) 772204 | They were thrown together | | Trinity College |-------------------------| In a heat of passion | | Dublin 2, | woof /\___/ | - "Human Fly", | | Ireland. | /| |\ | The Horseflies | *------------------------------------------------------------------------------*