Question

I'm trying to build rrdtool-1.4.8 on a machine with CentOS 4.1, and when I run the configure script, despite adding -I/usr/include/glib-2.0 and -I/usr/lib64/glib-2.0/include to CPPFLAGS:

# ./configure --disable-tcl --disable-python --disable-rrd_graph CFLAGS="-O3 -fPIC" \
LIBS="-lm  -lwrap -lglib-2.0" LDFLAGS="-Wl,--rpath -Wl,/mypath/lib/libxml2/lib" \
CPPFLAGS="-I/mypath/lib/libxml2/include/libxml2/libxml -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include" \
PKG_CONFIG_PATH=/mypath/lib/libxml2/lib/pkgconfig

The following error gets thrown:

Find 3rd-Party Libraries
checking dbi/dbi.h usability... no
checking dbi/dbi.h presence... no
checking for dbi/dbi.h... no
checking tcpd.h usability... yes
checking tcpd.h presence... yes
checking for tcpd.h... yes
checking for hosts_access... yes
checking for glib_check_version in -lglib-2.0... no
checking for pkg-config... pkg-config
checking for glib_check_version in -lglib-2.0... no
configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of glib-2.0. Check config.log for hints on why
  this is the case. Maybe you need to set LDFLAGS and CPPFLAGS appropriately
  so that compiler and the linker can find libglib-2.0 and its header files. If
  you have not installed glib-2.0, you can get it either from its original home on

     ftp://ftp.gtk.org/pub/glib/2.28/

  You can find also find an archive copy on

     http://oss.oetiker.ch/rrdtool/pub/libs

  The last tested version of glib-2.0 is 2.28.7.

       LIBS=-lm  -lwrap -lglib-2.0 -lglib-2.0  
   LDFLAGS=-Wl,--rpath -Wl,/mypath/lib/libxml2/lib    
  CPPFLAGS=-I/mypath/lib/libxml2/include/libxml2/libxml -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  

----------------------------------------------------------------------------
checking for xmlParseFile in -lxml2... no
checking for pkg-config... (cached) pkg-config
checking for xmlParseFile in -lxml2... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
configure: error: Please fix the library issues listed above and try again.

But glib2-devel package is already installed:

# yum list installed | grep glib2
glib2.x86_64                             2.4.7-1                installed       
glib2.i386                               2.4.7-1                installed       
glib2-devel.x86_64                       2.4.7-1                installed

I realize I'm probably missing something very trivial, but what am I doing wrong?

Is glib-2.0 the wrong version? Should I compile a more recent one and link it?

Was it helpful?

Solution

In case anyone else has this problem, the version of glib-2.0 was outdated.

To solve this, update glib-2.0 to a more recent version, and then run the configure script.

$./configure --disable-tcl --disable-python \
  CFLAGS="-O3 -fPIC" LIBS="-lm  -lwrap" \
  PKG_CONFIG_PATH=/mypath/lib/libxml2/lib/pkgconfig:/mypath2/glib-2.0/lib/pkgconfig \
  --prefix=/mypath3 \

After the configure script runs successfully, call make to compile the src.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top