SOLVED(?): failed to load "./stock_about_16.png": Couldn't recognize the image file format
- From: "Charles Wilson" <cygwin cwilson fastmail fm>
- To: gtk-devel-list gnome org
- Cc: png-mng-implement lists sourceforge net
- Subject: SOLVED(?): failed to load "./stock_about_16.png": Couldn't recognize the image file format
- Date: Wed, 24 May 2006 03:59:54 -0400
There have been numerous reports of the following error:
failed to load "./stock_about_16.png": Couldn't recognize the image file
format
for file './stock_about_16.png'
from people compiling gtk+ on various platforms (see bugzilla 108718 and
102142). I got the error on Solaris9, and a little digging revealed
that my .loaders file listed all of the loaders except png. Running
'make gdk-pixbuf.loaders' manually showed a missing symbol/relocation
error when trying to load libpixbufloader-png.so.
Short version: LIBPNG was '-L/path/to/lib -lpng12' but needed to be
'-L/path/to/lib -lpng12 -lz' because my libpng was shared, and linked
against a shared zlib. Unless -lz is explicitly linked as a dependency
when compiling libpixbufloader-png.so, when libpixbufloader-png.so is
dlopened that zlib dependency is dropped, and libz.so is not loaded --
so gdk-pixbuf-query-loaders gets that missing symbol error for
libpixbufloader-png.so. Only the direct dependencies of
libpixbufloader-png.so are loaded with it, and not the third-level ones.
However, building libpixbufloader-png.so with an explicit link
dependency on -lz should NOT be necessary: libpixbufloader-png.so
doesn't use zlib directly. And, "deep linking" like this is bad:
http://lists.debian.org/debian-devel-announce/2005/11/msg00016.html
which is why the png folks have had a long policy against including -lz
in their pkg-config --libs output (.pc file). However, it seems that on
some platforms (Solaris, HP?, to judge by the error reports) the runtime
loader works differently when implicitly loading a shared library at
application startup, than when loading it via dlopen(). In the former
case, the lower-level dependency gets loaded even tho the app did not
link directly against it. In the latter case...see above.
I don't have a universal non-ugly solution to the general problem -- but
I wanted to at least record this workaround for the next person who ran
into this error with gtk+:
Manually add -lz to LIBPNG in the gdk-pixbuf/Makefile.
--
Chuck
--
Charles Wilson
cygwin at removespam cwilson dot fastmail dot fm
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]