On Wed, Jan 03, 2001 at 10:06:16AM -0600, Chris Frost wrote:
> How can I look at a binary to see if it was compiled with lesstif? (I'm
> testing something on a machine with both lesstif and motif, and want to
> make sure I'm actually using lesstif.)
>
> thanks!
Well, the actual linked shared lib should be displayed by some 'ldd foo',
but you may aim to have something from within the code.
I have some code for this under development (called 'xmversion'),
here's an outdated code snippet which should give you the idea.
Actually there's a compile-time info (XmVERSION_STRING from Xm.h) and
a run-time info (_XmVersionString from libXm) available.
#include <Xm/Xm.h>
/*
We use
XmVERSION_STRING from Xm.h and
_XmVersionString from libXm
*/
/* This is not declared anywhere AFAIK ?! */
extern const char _XmVersionString[];
#ifdef __EMX__
#define STRICMP stricmp
#else
#define STRICMP strcasecmp
#endif
void GetXmInfo(void);
int
main (int argc, char *argv[])
{
GetXmInfo();
exit(0);
}
void GetXmInfo(void) {
FILE *outfile;
const char *xvs;
char *appname;
#ifdef __EMX__
char libname[]="Xm";
#else
char libname[]="libXm.so";
#endif
outfile = stdout;
/* make a copy; perhaps we want to re-format it */
xvs = strdup (_XmVersionString);
fprintf (outfile, "Was built against %s\n", XmVERSION_STRING);
fprintf (outfile, "Current runtime is %s\n", xvs);
}
--
Alexander Mai
[EMAIL PROTECTED]