Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!richsun!joan From: joan@richsun.UUCP (Joan Siebenaler) Newsgroups: comp.windows.x Subject: Problem with X Shared Libraries Message-ID: <389@richsun.UUCP> Date: 13 Jun 89 16:20:29 GMT Reply-To: joan@richsun.UUCP (Joan Siebenaler) Distribution: na Organization: RICH Inc., Franklin Park, IL Lines: 29 I've had a problem running programs linked with the X built Shared Libraries on Sun machines. The problem is in the Xt code. When a widget sets a procedure in it's class record to inherent the parents procedure the _XtInherit error function is called and exits. The widget initialization code does a compare of the _XtInherit address with the value stored in the Widget's class record. The XtInherit procedures XtInsertChild, XtInheritResize, XtRealize, etc. are define as the _XtInherit procedure. In the widgets class initialization if the value stored in the class record is equal to the _XtInherit function address the widget's parent procedure address is stored in the class record. When the Xt library is built as a shared library the _XtInherit address is resolved to a library branch table entry and is not equal to the value set in the widgets class record. The conditional branch is not taken and the widget's parent procedure is not inherited. To fix this problem I defined all the XtInherit procedures to a constant and defined _XtInherit equal to the same constant. This flags the widget initialization to inherit the parents procedure and an address comparison is not done. Has anyone else out there had this problem. Should the link editor be able to resolve the address comparison of a shared library procedure with the procedure address stored in the non-shared code, or should address comparisons not be done. Thanks for any help or comments you can give me. Joan Siebenaler (312) 455-6100, ext 621 uunet!richsun!joan