[collectd] librrd needs now libpng
Luboš Staněk
lubek at users.sourceforge.net
Fri Nov 24 15:10:24 CET 2006
Hi,
I think it must be some linker trouble. The linker solves dependencies
searching in standard libraries and provided libraries and path. I think
that you should add the library or library path to your LDFLAGS to
provide it to the configure script.
Or the libpng library differs from the one used when linking librrd.
I have the libpng-1.2.8, nonversioned, and the configure and build works
well.
$ ldd collectd
linux-gate.so.1 => (0x00bc2000)
libm.so.6 => /lib/libm.so.6 (0x00dd0000)
librrd.so.2 => /usr/lib/librrd.so.2 (0x0066e000)
libresolv.so.2 => /lib/libresolv.so.2 (0x00a64000)
libstatgrab.so.6 => /usr/lib/libstatgrab.so.6 (0x00149000)
libdl.so.2 => /lib/libdl.so.2 (0x00a22000)
libc.so.6 => /lib/libc.so.6 (0x00268000)
/lib/ld-linux.so.2 (0x00bc3000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00939000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00ccc000)
libz.so.1 => /usr/lib/libz.so.1 (0x00111000)
libart_lgpl_2.so.2 => /usr/lib/libart_lgpl_2.so.2 (0x00d6d000)
I can simulate a similar error after removing libpng*.* from /usr/lib.
configure:35459: checking for rrd_update in -lrrd
configure:35489: gcc -o conftest -O2 -g -pipe -Wall -lrrd -lm >&5
/usr/bin/ld: warning: libpng12.so.0, needed by
/usr/lib/gcc/i386-redhat-linux/4.0.2/../../../librrd.so, not found (try
using -rpath or -rpath-link)
/usr/lib/gcc/i386-redhat-linux/4.0.2/../../../librrd.so: undefined
reference to `png_set_text'
...
Best regards,
a beginner in Linux programming
Lubos
Niki W Waibel napsal(a):
> hi, just tried to compile latest collectd (3.10.3) on solaris10.
>
> it seems that the latest version (1.2.15) of rrdtool needs
> -lpng. during configure, collectd does the librrd check
> without adding -lpng -> fails always:
> ===
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_destroy_write_struct at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_write_end at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_set_compression_level at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_destroy_read_struct at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_create_read_struct at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_read_info at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_create_write_struct at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_set_IHDR at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_set_text at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_set_filter at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_create_info_struct at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_get_image_height at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_init_io at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_write_info at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_get_image_width at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_malloc at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_write_image at PNG12_0'
> /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so: undefined reference to `png_free at PNG12_0'
> ===
>
> the following patch can fixes it.
> ===
> diff -u -r collectd-3.10.3.orig/configure collectd-3.10.3/configure
> --- collectd-3.10.3.orig/configure 2006-11-04 13:52:31.000000000 +0100
> +++ collectd-3.10.3/configure 2006-11-22 18:30:26.496063776 +0100
> @@ -36987,7 +36987,7 @@
> echo $ECHO_N "(cached) $ECHO_C" >&6
> else
> ac_check_lib_save_LIBS=$LIBS
> -LIBS="-lrrd -lm $LIBS"
> +LIBS="-lrrd -lm -lpng $LIBS"
> cat >conftest.$ac_ext <<_ACEOF
> /* confdefs.h. */
> _ACEOF
> diff -u -r collectd-3.10.3.orig/configure.in collectd-3.10.3/configure.in
> --- collectd-3.10.3.orig/configure.in 2006-11-04 13:52:30.000000000 +0100
> +++ collectd-3.10.3/configure.in 2006-11-22 18:28:08.638912995 +0100
> @@ -467,7 +467,7 @@
> [
> AC_DEFINE(HAVE_LIBRRD, 1, [Define to 1 if you have the rrd library (-lrrd).])
> ],
> - [with_rrdtool="no (librrd not found)"], [-lm])
> + [with_rrdtool="no (librrd not found)"], [-lm -lpng])
> fi
> if test "x$with_rrdtool" = "xyes"
> then
> ===
> but you might want to
> * check if librrd works without -lpng
> * check if librrd works with -lpng (and add -lpng)
> * fail and assume, that there is no librrd
> which makes things more complicated as in the patch above.
>
> it's strange that -lpng needs to be specified, because the other libs, librrd depends on:
> ===
> $ ldd /opt/newlogic/sparc-sun-solaris2.10/lib/librrd.so
> libpng12.so.0 => /opt/newlogic/sparc-sun-solaris2.10/lib/libpng12.so.0
> libm.so.2 => /lib/libm.so.2
> libart_lgpl_2.so.2 => /opt/newlogic/sparc-sun-solaris2.10/lib/libart_lgpl_2.so.2
> libfreetype.so.6 => /opt/newlogic/sparc-sun-solaris2.10/lib/libfreetype.so.6
> libz.so.1 => /opt/newlogic/sparc-sun-solaris2.10/lib/libz.so.1
> libc.so.1 => /lib/libc.so.1
> ===
> do not need to be specified. maybe that's because libpng uses versioned symbols now...
>
> rds, niki
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> collectd mailing list
> collectd at verplant.org
> http://mailman.verplant.org/listinfo/collectd
More information about the collectd
mailing list