[GRASS5] PNG driver: libgd2 pickup problem

Markus Neteler neteler at itc.it
Tue Apr 23 08:29:32 EDT 2002


On Tue, Apr 23, 2002 at 12:29:52PM +0100, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > browsing the archive I found a bit of help to compile the PNG
> > driver against libgd2.x. But when I use it, it picks up
> > the libgd1.8...
> > 
> > d.mon PNG
> > PNG: GRASS_TRUECOLOR status: TRUE
> > /mpa_sw/ssi/BIO/software/GRASS5.0.0/grass5bin_cvs/grass5/driver/PNG:
> > relocation error: /mpa_sw/ssi/BIO/software/GRASS5.0.0/grass5bin_cvs/grass5/driver/PNG:
> > undefined symbol: gdImageCreateTrueColor
> > No socket to connect to for monitor <PNG>.
> > Problem selecting PNG. Will try once more
> > No socket to connect to for monitor <PNG>.
> > 
> > nm /usr/local/lib/libgd.so.2.0.0 |grep gdImageCreateTrueColor
> > 00004a18 T gdImageCreateTrueColor
> > 
> > This indicates, that libgd1.8 is used, but the driver compiled against
> > 2.x. Any suggestions to solve this run-time problem?
> > 
> > ldd /mpa_sw/ssi/BIO/software/GRASS5.0.0/grass5bin_cvs/grass5/driver/PNG
> >         libgd.so => /usr/lib/libgd.so (0x40017000)
> >         libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x4004a000)
> >         libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40080000)
> >         libpng.so.2 => /usr/lib/libpng.so.2 (0x4009f000)
> >         libm.so.6 => /lib/libm.so.6 (0x400d6000)
> >         libc.so.6 => /lib/libc.so.6 (0x400f8000)
> >         libttf.so.2 => /usr/lib/libttf.so.2 (0x4022d000)
> >         libz.so.1 => /usr/lib/libz.so.1 (0x40257000)
> >         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
> 
> Re-compile libgd 2.x to include an explicit soname. In the gd
> Makefile, change:
> 
> 	ld -shared -o libgd.so.${VERSION} ${LIBOBJS}
> to:
> 	ld -shared -soname libgd.so.2 -o libgd.so.${VERSION} ${LIBOBJS}
> 
> Then, "ldd" will report e.g.:
> 
> 	libgd.so.2 => /usr/local/lib/libgd.so.2 (0x4001c000)
> 
> and the loader will try to use libgd.so.2 in preference to libgd.so.

[I have also seen your other mail]
The problem is that I am not "root" here. So I cannot do too much with
libgd.

A suggestion: Couldn't "configure" refer to the version -lgd.so.2
or so when the test for gdImageCreateTrueColor is successfull and
refer to -lgd otherwise?
Then it should be fine also for non-root users or all those who
do not know/want to recompile GD.
 
> Also, you may be able to work around the problem by setting
> LD_LIBRARY_PATH, but that may be undesirable (it will affect all
> libraries, not just gd). Alternatively, you could put a link to
> libgd.so into $GISBASE/lib, as the GRASS startup adds that directory
> to LD_LIBRARY_PATH.
> 
> Note: at present, the GRASS shared libraries don't include explicit
> sonames. That should be changed if we intend to release a binary
> distribution using shared libraries, to prevent this sort of problem.


Markus



More information about the grass-dev mailing list