Path: utzoo!attcan!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!bloom-beacon!morgan.COM!jordan From: jordan@morgan.COM (Jordan Hayes) Newsgroups: comp.windows.x Subject: Re: SUMMARY ld.so __XtInherit not found Message-ID: <9011151225.AA14906@s6.Morgan.COM> Date: 15 Nov 90 12:25:36 GMT References: <9011131740.AA24472@theopolis.orl.mmc.com> Sender: daemon@athena.mit.edu (Mr Background) Organization: Morgan Stanley, & Co., Inc. / New York City, NY Lines: 49 When I run a X program that I wrote I get the error ld.so symbol not found __XtInherit [ Should this go into FAQ? ] Here's what is happening. There is a kludge in libXt to get Sun shared libraries to work, which involves this __XtInherit business. The reason for it is that you can't share a function that is both called and compared -- _XtInherit is the only function that I know of in libXt that does this. i.e., if (wc->manager_class.translations == (XtTranslations)_XtInherit) The trick is to find some function that is *guaranteed* to be called in an application and put the definition of _XtInherit into the same .o file ... XtToolkitInitialize is the right choice for this, since (theoretically) it should be called before any of the other Intrinsics functions, thus ensuring that _XtInherit will get referenced, and thus, loaded. Bottom line: one of two things is happening: 1) You aren't calling XtToolkitInitialize() anywhere. -- uil in motif 1.1 has this problem -- Solution: make sure you call XtToolkitInitialize(); all of the standard *Initialize() functions do this, so unless you are doing something before initializing the Intrinsics, you should be okay. 2) You don't *need* to call XtToolkitInitialize() in your program. This can happen if you are writing only in Xlib, or using a toolkit that is not Xt-intrinsics based. -- XView doesn't use the Intrinsics, for example -- Solution: take the library -lXt out of your link command. ----- The non-solution of linking -Bstatic "works" because this is an artifact of shared libraries. Don't bother -- one of the other two ways above shold work. /jordan