Subject: Re: FVWM: Error loading PNG on Solaris

From: Ben Sferrazza <[email-masked]>
Date: Mon, 22 Sep 2003 18:23:56 -0700

Hi,

I've always had problems using PNG icons with FVWM, despite it being 
built correctly (fvwm-configure shows png support as 'yes').  My machine 
was recently upgraded to Solaris 8 (or 2.8 depending on nomenclature) 
and I was hoping that by rebuilding the latest beta FVWM (2.5.7) that 
I'd find PNGs to now work.  But unfortunately they still do not.  Then I 
just noticed this CVS update that was done on 6/6.

CVSROOT:	/home/cvs/fvwm
Module name:	fvwm
Changes by:	olicha	03/06/06 10:44:04

Modified files:
	.              : ChangeLog
	libs           : PictureImageLoader.c

Log message:
* Fixed loading of png images if the caller want no alpha

I built the snapshot from June 7, but not only do PNGs not display 
still, but I'm having other problems.

What's a good, stable snapshot on Solaris that would include any updates 
related to PNG?

All I'm doing by the way is a simple line like this:

Style "xterm" myicon.png

No other PNG related lines in my .fvwm2rc file.  That's it.  Yet, when I 
iconify an xterm window, I get no icon and this is the output

*FvwmConsole version 2.5.7
[FVWM][GetIconFromFile]: <<ERROR>> Failed to load /path/to/my/pngfile.png

The path is certainly correct, and I've tried using other PNGs with the 
same problem.  I'm also able to view them with no problem with GIMP. 
It's only within FVWM that there's this problem.

Any help getting PNGs working with Solaris is much appreciated.

Thank you,
Ben

Dan Espen wrote:
> Ben Sferrazza <[email-masked]> writes:
> 
>>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?
> 
> 
> 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.
> 

--
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: Mikhael Goikhman <[email-masked]>
Date: Tue, 23 Sep 2003 12:52:12 +0300

I can't say anything on the subject (PNG on Solaris), just some notes.

> What's a good, stable snapshot on Solaris that would include any updates 

The latest cvs is always thought to be prefereable, at least in the
feature freeze period.

> [FVWM][GetIconFromFile]: <<ERROR>> Failed to load /path/to/my/pngfile.png

It should say 2.5.8 (from cvs) if it is really the snapshot from June 7.

Can you please build the latest cvs, so we don't speak about past
versions, and install it using "make install". Verify that fvwm-config
--info lists png support and you run the correct executable.

Actually, you don't even need to install anything to verify the png
support in FVWM. After "make", just run bin/fvwm-root with your png file
to see whether it works, it should set the root background.

Regards,
Mikhael.

---

From: Ben Sferrazza <[email-masked]>
Date: Tue, 23 Sep 2003 10:04:56 -0700

Thanks for the fvwm-root suggestion.  I think that seems to share the 
cause of my troubles.

% fvwm-root ~/bin/fvwm-icons/dtterm.png

libpng warning: Application was compiled with png.h from libpng-1.0.1
libpng warning: Application  is  running with png.c from libpng-1.2.5
libpng error: Incompatible libpng version in application and library
[fvwm-root] failed to load image file '~/bin/fvwm-icons/dtterm.png'

I'm not quite sure why this would be happening.  Perhaps it's finding 
the libpng-1.0.1 png.h file from a system wide directory before finding 
my local 1.2.5 png.h file.  Maybe I just need to reorder my 
LD_LIBRARY_PATH?  Any suggestions?

thanks,
Ben

---

From: Dan Espen <[email-masked]>
Date: Tue, 23 Sep 2003 13:23:19 -0400

> LD_LIBRARY_PATH?  Any suggestions?

You shouldn't try to use LD_LIBRARY_PATH.

Use "-R libname" during build, set it using LD_OPTIONS.

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

---

From: Ben Sferrazza <[email-masked]>
Date: Tue, 23 Sep 2003 10:39:53 -0700

I do use LD_OPTIONS to use "-L libname -R libname", and I do use 
"--with-png-includes=mypath/lib-png-1.2.5/include" with configure too.

Yet somehow it's using a png.h from libpng-1.0.1.  The png.h in 
'mypath/lib-png-1.2.5/include' is indeed the png.h from 1.2.5, and my 
configure.log shows it finding the png.h from that directory and not 
some other one.

this is really odd.

Ben

---

From: Ben Sferrazza <[email-masked]>
Date: Wed, 24 Sep 2003 18:30:44 -0700

This is still confusing me.  I even checked my Makefile and the path to 
my png.h seems correct.

png_CFLAGS = -I/lsi/vp/spiderman/user/bsferraz/bin/libpng-1.2.5/include
png_LIBS = -lpng -lz

Yet after I make everything I get that warning that fvwm-root was 
compiled with png.h from libpng-1.0.1.  Could some other system path, 
such as /usr/local/include, be overriding my local path?  How could I 
force it to find the png.h of 1.2.5 from my local directory?

thanks,
Ben

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 25 Sep 2003 09:43:33 +0200

> force it to find the png.h of 1.2.5 from my local directory?

Did you search your system for other copies of the library?  If
there is one, try moving it to some obscure place to see if it is
used.  If there is none, your libpng must be broken.  Perhaps the
installed header files do not match the library?

P.S.:  Please don't post your replies at the top of your mails on
this list.

> >Use "-R libname" during build, set it using LD_OPTIONS.

Ciao

Dominik ^_^  ^_^

---

From: Ben Sferrazza <[email-masked]>
Date: Thu, 25 Sep 2003 10:13:53 -0700

Response below.

> P.S.:  Please don't post your replies at the top of your mails on

Yes, there are other copies of the png.h header file in 
/usr/local/include, but since I do not have root access to this system, 
I can't simply move this copy.  Is there any system variable that I 
could use to set the include path?  I need to have the compiler search 
in my local directories prior to searching in system wide directories , 
such as /usr/local/include.

Thanks
Ben

---

From: Ben Sferrazza <[email-masked]>
Date: Thu, 25 Sep 2003 12:13:46 -0700

> P.S.:  Please don't post your replies at the top of your mails on

I copied the png include files to the fvwm directory where I was running 
'make' and that seems to have forced it to use the correct version of 
png.h.  I finally have PNG support with FVWM!  Thanks.