Subject: Re: FVWM: Question about configuring with libXpm

From: Dan Espen <[email-masked]>
Date: Sun, 24 Mar 2002 07:24:10 -0500

[email-masked] writes:
> Dan --
> 
> Thank you for your reply.  I am  trying to use libXpm.so.4.11.  This
> was indeed included with the Mandrake distribution and was installed
> in /usr/X11R6/lib.  But I  got   essentially the same messages    as
> below.
> So I tried  downloading the binary from ftp.x.org/contrib/libraries.
> This  was not  the  same  as  the  one  included  with  the Mandrake
> distribution, so I  tried using this  -  same failure.  And that  is
> where I am now.

When you reply, remember to always reply to [email-masked].

Try to simplify the problem.

The configure test is trying to compile and link this little program:

char XpmReadFileToXpmImage();
int main() {
 XpmReadFileToXpmImage();
 return 0;
}

Take those lines and put them in a file named conftest.c.

Then run this command in the same directory:

gcc -o conftest -g -O2   conftest.c -lXpm \
/usr/X11R6/lib/libXpm.so  -L/usr/X11R6/lib  -lSM -lICE -lX11

Let us know what that does.

Try this command:

nm /usr/X11R6/lib/libXpm.so | grep fxstat

Let us know what that does.

Another thing to try is building and installing libXpm instead
of downloading a binary.

Other than that, I have no clue.  Perhaps someone else on the list
has an idea.

> 
> -- Bob
> 
> 
> Dan Espen writes:
>   > [email-masked] writes:
>   > > I am building fvwm on Linux [version info: Linux version 2.4.8-26mdk
>   > > ([email-masked]) (gcc version 2.96 20000731 (Mandrake Lin
> ux 8.1
>   > > 2.96-0.62mdk)) #1 Sun Sep 23 17:06:39 CEST 2001].  I have downloaded th
> e
>   > > latest version of Xpm but configure insists a usable version of libXpm 
> cannot
>   > > be found.  Here is the relevant portion of config.log.
>   > > 
>   > > This file contains any messages produced by compilers while
>   > > running configure, to aid debugging if configure makes a mistake.
>   > > 
>   > > . . .
>   > > 
>   > > configure:2538: checking for XpmReadFileToXpmImage in -lXpm
>   > > configure:2557: gcc -o conftest -g -O2   conftest.c -lXpm /usr/lib/libX
> pm.so 
>   > >  -L/usr/X11R6/lib  -lSM -lICE -lX11   1>&5
>   > > /usr/X11R6/lib/libXpm.so: undefined reference to `_fxstat'
>   > > collect2: ld returned 1 exit status
>   > > configure: failed program was:
>   > > #line 2546 "configure"
>   > > #include "confdefs.h"
>   > > /* Override any gcc2 internal prototype to avoid an error.  */
>   > > /* We use char because int might match the return type of a gcc2
>   > >     builtin and then its argument prototype would still apply.  */
>   > > char XpmReadFileToXpmImage();
>   > > 
>   > > int main() {
>   > > XpmReadFileToXpmImage()
>   > > ; return 0; }
>   > > 
>   > > . . .
>   > > 
>   > > Comments about dealing with this will be appreciated.
>   > 
>   > Running "nm" on my copy of libXpm.so and looking for fxstat I see:
>   > 
>   > nm /usr/X11R6/lib/libXpm.so
>   > ...
>   >          U __fxstat@@GLIBC_2.0
>   > ...
>   > 
>   > I believe I'm running the same version of Mandrake you are.
>   > I believe libXpm was already in /usr/X11R6/lib, perhaps I selected
>   > it during the install.
>   > 
>   > Anyway, I believe the "U" indicates that the symbol is undefined,
>   > but it expects to resolve it from GLIBC_2.0.
>   > 
>   > You don't say what version of Xpm you are trying to use or whether
>   > you built it yourself...
>   > 
>   > -- 
>   > Dan Espen                           E-mail: [email-masked]

-- 
Dan Espen                           E-mail: [email-masked]
444 Hoes Lane  Room RRC 1C-214      Phone: (732) 699-5570
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked]
Date: Wed, 27 Mar 2002 14:53:39 -0800

Dan --

I appreciate the suggestions, and apologize for the delay in replying.  My
e-mail is erratic at the moment.

I followed your suggestion with the following result:

knighten:~/C gcc -o conftest -g -O2   conftest.c -lXpm /usr/X11R6/lib/libXpm.so  -L/usr/X11R6/lib  -lSM -lICE -lX11

which appears to be just what is happening with configure.

And looking for _fxstat in the output of nm /usr/X11R6/lib/libXpm.so shows
         U _fxstat

I've not tried rebuilding libXpm.so as it does appear to work.

I have tried getting around configure and reworking the makefile so link with
libXpm.so, but I haven't been successful with that.

-- Bob

---

From: [email-masked]
Date: Wed, 27 Mar 2002 15:20:20 -0800

Dan Espen writes:

. . .

. . .

I did and that solved the problem.  I was slow to do this because emacs uses
libXpm.so and was having no problems, but this just goes to show.

Thank you for the help.

-- Bob