The following code is what I use.  _XmVersionString is defined in the
library, and will be available after initialization.

-Jon

#ifdef __linux
    /* final LessTif Version checking */
    extern char _XmVersionString[];

    if (strcmp(XmVERSION_STRING,_XmVersionString)!=0) {
      char buf[BUFSIZ];
      sprintf(buf,
              "This version of spock was compiled with %s.\n"
              "The version on this system is %s.\n"
              "This may cause difficulties and random crashes when using menus\n"
              "or dialog boxes.\n\n"
              "For best performance, you should install %s,\n"
              "available from www.lesstif.org.\n",
              XmVERSION_STRING,_XmVersionString,XmVERSION_STRING);
      SPError(buf);
    }
#endif






On Wed, 25 Oct 2000, Erik Luijten wrote:

>Hi,
>
>I have written a Motif 2.0 program. If I execute the (dynamic) executable
>on a system that has only the LessTif version of libXm.so.2 (i.e. not the
>OSF one), it does not behave so well yet. Therefore, I'd like to know
>(within the program) what library I'm dealing with. At compile time, one
>can examine XmVERSION_STRING, but of course that's of no use at execution
>time. Is there any trick to find out? Or a Motif function that returns
>the VersionString?
>
>Many thanks, Erik
>
>
>

--
Dr. Jon A. Christopher           (858) 558-4850, ext 151
Structural GenomiX               [EMAIL PROTECTED]
10505 Roselle St.
San Diego, CA 92121

Reply via email to