>>>>> On Thu, 27 Apr 2000 14:29:39 -0500, Charles McKnight <[EMAIL PROTECTED]> said:

  Charles> I've just downloaded, built, and installed LessTif 0.90.1, and am trying
  Charles> to get the examples from the O'Reilly Motif Programming Manual to run.

  Charles> Using the following command line:

  Charles> gcc -ohello -I/usr/local/LessTif/Motif1.2/include -I/usr/X11R6/include
  Charles> -L/usr/X11R6/lib -L/usr/local/LessTif/Motif2.0/lib -lXt -lXm -lX11
  Charles> hello.c

Perhaps LessTif can guard against this common linking problem?  E.g. the
following function will check the VendorShell for consistency:

------------------------------------------------------------------------------
RCS file: /cvsroot/hungry/lesstif/lib/Xm/Vendor.c,v
retrieving revision 1.51
diff -u -r1.51 Vendor.c
--- Vendor.c    2000/01/26 12:43:53     1.51
+++ Vendor.c    2000/05/04 15:23:33
@@ -3190,6 +3190,25 @@
     }
 }
 
+/* To be used for sanity checking */
+Boolean
+_LtCheckClassOfVendorShell(Widget w)
+{
+    WidgetClass class;
+
+    for (class = XtClass(w); class != NULL; class = class->core_class.superclass)
+    {
+        if (0 == strcmp(class->core_class.class_name, "VendorShell")) {
+            if (class->core_class.extension == (XtPointer)&_XmVendorSCoreClassExtRec)
+                return TRUE;
+            else
+                _XmError(w, "Application not linked correctly: try putting Xm before 
+Xt.");
+        }
+    }
+
+    return FALSE;
+}
+
 /* This fixes different shared library mechanism in OS/2 
    compared to the standard Unix OS's.
    The routine should be called before any other function,
------------------------------------------------------------------------------


It can be used like this to catch the above error:

------------------------------------------------------------------------------
RCS file: /cvsroot/hungry/lesstif/lib/Xm/Display.c,v
retrieving revision 1.15
diff -u -r1.15 Display.c
--- Display.c   2000/01/05 23:44:43     1.15
+++ Display.c   2000/05/04 15:25:05
@@ -464,6 +464,9 @@
 }
 #endif
 
+Boolean _LtCheckClassOfVendorShell(Widget w);
+
+
 /*
  * This is the real place, where we try to find the XmDisplay widget of
  * a display. If we can't get our hands on the widget, we create one.
@@ -509,6 +512,8 @@
         * The XmDisplay widget is now already registered as the display
         * object (this is done in DisplayInitialize()).
         */
+
+        _LtCheckClassOfVendorShell(DisplayWidget);
     }
 
     /*
------------------------------------------------------------------------------

__Martin

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

Reply via email to