[Mapserver-users] httpd-error.log: Incompatible libpng version

Martin Weinelt mweinelt at planiglobe.com
Tue Dec 23 11:00:48 EST 2003


On Tuesday 23 December 2003 15:41, Daniel Morissette wrote:
> Benjamin Thelen (CCGIS) wrote:
> > [Mon Dec 22 17:03:38 2003] [error] [client 192.168.2.109] Premature end
> > of script headers: /usr/local/www/cgi-bin/mapserv
> > libpng warning: Application was compiled with png.h from libpng-1.0.6
> > libpng warning: Application  is  running with png.c from libpng-1.2.5
> > libpng error: Incompatible libpng version in application and library
> >
> > I have compiled mapserver --with-png=/usr/local. png.h is located in
> > /usr/local/include.
> >
> > I suppose "Application" refers to the mapserver binary. But png.h is
> > definitely version 1.2.5. So I really don't understand this error
> > message telling me that mapserver was compiled with a png.h from version
> > 1.0.6!?
>
> Are you really sure that there is no other png.h anywhere on your
> system, and that there was none at the time that you compiled MapServer?
>
> Just using --with-png=/usr/local doesn't prevent the compiler from using
> /usr/include/png.h if it finds one. So you really need to have only one
> png.h in your system directories no matter which configure options you use.
>
> Note that in this case the "application" that uses libpng is libgd.so,
> which in turn is used by MapServer... I also think that GDAL may link in
> libpng, or even carry its own internal copy, so that's another thing to
> check.

And check what libpng-config spits out about your installation. This is used 
by gd to collect information on your png package. If you (must) have 
different versions of png installed you might try to configure gd 
'--with-png="/the/path/to/the/new/libpng-config" or edit the Makefile 
accordingly. 

When you build gd you can always issue a  'ldd -r  libgd.so.2.0.0' to see if 
it uses your favorite version of libpng. If that is the case and your 
error-log still has this warnings check the environment of the httpd 
(LD_LIBRARY_PATH). It is the env of the 'user' running the httpd or you set 
it in httpd.conf.

Martin


> > Does anybody have an idea? I have alread removed many, many packages,
> > which need png and reinstalled/compiled those again. But it did not help.
>
> About removing packages: in general you don't need to remove the older
> lib completely and you can keep the runtime part of the package. You
> need only to remove the "devel" part of the package which includes the
> .h files and libpng.so which is a symlink to libpng.so.1.0.6. The
> runtime libpng.so.1.0.6 can remain on your system and if the libs are
> well configured then your old apps will continue to work without needing
> a rebuild, and the old lib won't interfere with the newer apps that you
> compile and that will use libpng.so.1.2.5.
>
> Daniel






More information about the mapserver-users mailing list