Subject: FVWM: Error loading PNG on Solaris

From: Ben Sferrazza <[email-masked]>
Date: Fri, 04 Apr 2003 15:25:16 -0800

I've always had problems using PNG icons in FVWM, despite configuring 
make to support PNG on my Sun Solaris 2.7 system.  Here's the error 
output to FvwmConsole.

*FvwmConsole version 2.5.6
[FVWM][GetIconFromFile]: <<ERROR>> Failed to load 
/lsi/home/bsferraz/bin/fvwm-icons/konsole.png

The PNG file clearly exists there, and I've correctly added that 
directory to the ImagePath in my .fvwm2rc file and have no problems 
loading XPM pixmaps from that same directory.

When I use fvwm-configure to check that I indeed built in PNG support, I 
get the following output.

% fvwm-config --supports
gettext
gtk
perllib
png
readline
shape
shm
sm
xpm

So it appears that I've successfully added PNG support (using 
libpng-1.2.5), yet I cannot view the PNG icon in FVWM.  I have no 
problems viewing the same PNG using GIMP, and when trying to load in 
other PNGs in FVWM, I get the same error.

Are there other things I can do to nail down the cause of this problem? 
   Are there other users using SPARC-based Solaris that can correctly 
load PNGs with FVWM?  Would using FvwmDebug help?  For whatever reason 
when I try loading the FvwmDebug module in the resource file I'm not 
getting anything.

I appreciate any help.

Thanks,
Ben

--
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: Olivier Chapuis <[email-masked]>
Date: Tue, 15 Apr 2003 07:17:21 +0200

On Fri, Apr 04, 2003 at 03:25:16PM -0800, Ben Sferrazza wrote:
> load PNGs with FVWM?

Can you try a recent snapshot? Dorothy Robinson report a problem with
png on a solaris/sparc system (2002-11-28). The problem was fixed just
at 2.5.6 release time and I am not sure that the fix is in 2.5.6.

> Would using FvwmDebug help?  For whatever reason 

I do not think that FvwmDebug can help for this png problem.

Regards, Olivier

---

From: Ben Sferrazza <[email-masked]>
Date: Wed, 16 Apr 2003 09:51:54 -0700

Thanks for the reply Olivier.  I read through the emails that you 
exchanged with Dorothy.  Unfortunately her problem seems unrelated to 
mine.  For one, I also had tried using a snapshot from 2002-12-20 (that 
fixed a high-color problem I was having with Solaris), which is after 
the snapshot you provided on 2002-12-02 to fix Dorothy's problem.  I'm 
having problems even loading PNGs.

thanks,
Ben

---

From: Dan Espen <[email-masked]>
Date: Thu, 17 Apr 2003 08:42:03 -0400

> having problems even loading PNGs.

I just built png support into my Solaris version.  It worked fine.

I installed libpng1.2.5.

I'm not root so it was not installed in a standard library.
During make I had:

export LD_OPTIONS="-L/usr/local/lib -R/usr/local/lib"

the -R is important so that Fvwm can find the library.

If you are still having problems, try to supply more information.

-- 
Dan Espen                           E-mail: [email-masked]

---

From: Ben Sferrazza <[email-masked]>
Date: Thu, 17 Apr 2003 11:37:11 -0700

Hi Dan,

I tried re-building everything with even more explicit library paths, 
but I'm still not able to display a PNG with FVWM.  And like I said 
before everything shows that I've successfully built in PNG support. 
Here's what I used before running configure.

setenv LDFLAGS "-L /usr/local/lib -R /usr/local/lib
-L /usr/openwin/lib -R /usr/openwin/lib
-L /lsi/vp/spiderman/user/bsferraz/bin/xpm-3.4k-solaris
-R /lsi/vp/spiderman/user/bsferraz/bin/xpm-3.4k-solaris
-L /lsi/vp/spiderman/user/bsferraz/bin/libpng-1.2.5/lib
-R /lsi/vp/spiderman/user/bsferraz/bin/libpng-1.2.5/lib"

./configure --prefix=/lsi/home/bsferraz/bin/fvwm-2.5 
--with-xpm-library=/lsi/vp/spiderman/user/bsferraz/bin/xpm-3.4k-solaris/lib 
--with-xpm-includes=/lsi/vp/spiderman/user/bsferraz/bin/xpm-3.4k-solaris/include 
--with-png-library=/lsi/vp/spiderman/user/bsferraz/bin/libpng-1.2.5/lib 
--with-png-includes=/lsi/vp/spiderman/user/bsferraz/bin/libpng-1.2.5/include

Would it be OK if I attached a copy of my config.log file for you to 
quickly scan over?  Maybe you could find something that suggests why PNG 
support wasn't actually built-in although it reports it as such.  I 
appreciate your help.

thanks,
Ben

---

From: Dan Espen <[email-masked]>
Date: Thu, 17 Apr 2003 14:48:43 -0400

> -R /lsi/vp/spiderman/user/bsferraz/bin/libpng-1.2.5/lib"

Before you send me the log...

I don't think using LDFLAGS is the right way to go.
Use LD_OPTIONS.  Thats the way I do it.

Be sure to remove config.cache before you configure.
Also make sure everything gets rebuilt.

---

From: Dan Espen <[email-masked]>
Date: Thu, 17 Apr 2003 14:53:33 -0400

> Here's what I used before running configure.

I've been guessing that the -R isn't getting passed to the linker.
You can check that by unsetting LD_LIBRARY_PATH
and using ldd:

fork> ldd /usr/local/src/fvwm/2.5.7/fvwm
        libXpm.so.4.10 =>        /usr/local/lib/libXpm.so.4.10
        libSM.so.6 =>    /usr/lib/libSM.so.6
        libICE.so.6 =>   /usr/lib/libICE.so.6
        libXext.so.0 =>  /usr/lib/libXext.so.0
        libX11.so.4 =>   /usr/lib/libX11.so.4
        libsocket.so.1 =>        /usr/lib/libsocket.so.1
        libnsl.so.1 =>   /usr/lib/libnsl.so.1
        libm.so.1 =>     /usr/lib/libm.so.1
        libpng.so.3 =>   /usr/local/lib/libpng.so.3
        libz.so =>       /usr/lib/libz.so
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        libdga.so.1 =>   /usr/openwin/lib/libdga.so.1
        libmp.so.2 =>    /usr/lib/libmp.so.2
        /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1

ldd should be able to find all the libraries.

---

From: Ben Sferrazza <[email-masked]>
Date: Thu, 17 Apr 2003 12:08:48 -0700

I'm rebuilding now with LD_OPTIONS.  I'll let you know how that works out.

here's my ldd output:

ldd fvwm-2.5.6/bin/fvwm
         libXpm.so.4.11 =>        (file not found)
         libSM.so.6 =>    /usr/openwin/lib/libSM.so.6
         libICE.so.6 =>   /usr/openwin/lib/libICE.so.6
         libXext.so.0 =>  /usr/openwin/lib/libXext.so.0
         libX11.so.4 =>   /usr/openwin/lib/libX11.so.4
         libsocket.so.1 =>        /usr/lib/libsocket.so.1
         libnsl.so.1 =>   /usr/lib/libnsl.so.1
         libm.so.1 =>     /usr/lib/libm.so.1
         libpng.so.3 => 
/lsi/vp/spiderman/user/bsferraz/bin/libpng-1.2.5/lib/libpng.so.3
         libc.so.1 =>     /usr/lib/libc.so.1
         libdl.so.1 =>    /usr/lib/libdl.so.1
         libmp.so.2 =>    /usr/lib/libmp.so.2
         libucb.so.1 =>   /usr/ucblib/libucb.so.1
         libresolv.so.2 =>        /usr/lib/libresolv.so.2
         libelf.so.1 =>   /usr/lib/libelf.so.1

So it is using the same path for PNG that I provided during configure.

Ben

---

From: Dan Espen <[email-masked]>
Date: Thu, 17 Apr 2003 15:17:40 -0400

>          libXpm.so.4.11 =>        (file not found)

Notice that it can't find the xpm library.
Are you normally exporting LD_LIBRARY_PATH?

If so, what does the output look like with its normal setting?

---

From: Ben Sferrazza <[email-masked]>
Date: Thu, 17 Apr 2003 17:21:51 -0700

Dan,

Yes, I even added the library paths to LD_LIBRARY_PATH and tried 
re-building everything with LD_OPTIONS instead of LDFLAGS.  Still I have 
no luck displaying PNG files through FVWM.

Here's the output of ldd for my latest build.  It's now finding libXpm, 
but I'm now getting these SUNW issues which I didn't have before.  I 
don't this is related to the PNG problems though.

         libXpm.so.4.11 =>        /usr/local/lib/libXpm.so.4.11
         libSM.so.6 =>    /usr/openwin/lib/libSM.so.6
         libSM.so.6 (SUNWprivate) =>      (version not found)
         libICE.so.6 =>   /usr/openwin/lib/libICE.so.6
         libICE.so.6 (SUNWprivate) =>     (version not found)
         libXext.so.0 =>  /usr/openwin/lib/libXext.so.0
         libXext.so.0 (SUNW_1.1) =>       (version not found)
         libX11.so.4 =>   /usr/openwin/lib/libX11.so.4
         libX11.so.4 (SUNW_1.1) =>        (version not found)
         libsocket.so.1 =>        /usr/lib/libsocket.so.1
         libnsl.so.1 =>   /usr/lib/libnsl.so.1
         libm.so.1 =>     /usr/lib/libm.so.1
         libpng.so.3 => 
/lsi/vp/spiderman/user/bsferraz/bin/libpng-1.2.5/lib/libpng.so.3
         libc.so.1 =>     /usr/lib/libc.so.1
         libdl.so.1 =>    /etc/lib/libdl.so.1
         libmp.so.2 =>    /usr/lib/libmp.so.2
         libucb.so.1 =>   /usr/ucblib/libucb.so.1
         libresolv.so.2 =>        /usr/lib/libresolv.so.2
         libelf.so.1 =>   /usr/lib/libelf.so.1

I noticed your ldd output should libz.so.  Is this the zlib that libpng 
requires.  Of course when I built the libpng libraries, I had to link 
zlib, but do I now have to link zlib when building FVWM?

thanks,
Ben

---

From: Dan Espen <[email-masked]>
Date: Thu, 17 Apr 2003 20:37:44 -0400

> zlib, but do I now have to link zlib when building FVWM?

Unless you have a static libz, it should show libz.

I don't know why you have /usr/openwin/lib libraries not found,
maybe you should add -R/usr/openwin/lib to LD_OPTIONS.

I don't know if we are getting anywhere.  I think it would abort or
print an error if this is where the problem was.
I'll have to look around.  Maybe someone else has an idea.

How are you trying to display a PNG?

I simply did:

Style test Icon <full-path-to-png>

then I started an xterm:

xterm -name test

and iconified the window.

Does the png display with other programs.

"display" from ImageMagic works with .png.