原始碼編譯rrdtool提示找不到xxx.pc類問題處理

sunshine185發表於2017-06-20

1. 問題現象

      在Centos原始碼編譯rrdtool 出現一系列錯誤資訊,使用命令及報錯如下圖:

./configure --prefix=/usr/local/rrdtool
checking dbi/dbi.h usability... no
checking dbi/dbi.h presence... no
checking for dbi/dbi.h... no
checking rados/librados.h usability... no
checking rados/librados.h presence... no
checking for rados/librados.h... no
checking tcpd.h usability... no
checking tcpd.h presence... no
checking for tcpd.h... no
checking for glib_check_version in -lglib-2.0... no
checking for pkg-config... pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no glib-2.0.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

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 
   LDFLAGS=-Wl,--rpath -Wl,/usr/local/rrdtool/lib
  CPPFLAGS=

----------------------------------------------------------------------------
                
checking for g_regex_new... no
checking if pcre is available to supply the missing regex support in glib... checking now ...
checking for pcre_compile in -lpcre... no
checking for pkg-config... (cached) pkg-config
configure: WARNING:
----------------------------------------------------------------------------
* I found a copy of pkgconfig, but there is no pcre.pc file around.
  You may want to set the PKG_CONFIG_PATH variable to point to its
  location.
----------------------------------------------------------------------------

configure: WARNING:
----------------------------------------------------------------------------
* I could not find a working copy of pcre. 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 libpcre and its header files. If
  you have not installed pcre, you can get it either from its original home on

     get a newer glib and you will not need pcre at all

  You can find also find an archive copy on

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

  The last tested version of pcre is x.x.x.

       LIBS=-lm 
   LDFLAGS=-Wl,--rpath -Wl,/usr/local/rrdtool/lib
  CPPFLAGS=

----------------------------------------------------------------------------
                
checking for pcre_compile... no
configure: error: you need either glib with g_regex support or libpcre to compile rrdtool.


2. 原因分析

編譯時從pkg-config目錄中沒有找到xxx.pc檔案,應該是相應xxx-devel 包沒有安裝

3. 處理辦法

使用yum命令安裝好相應devel包即可
yum install glib2-devel  pcre-devel libpng-devel  pango-devel cairo-devel  libxml2-devel



相關文章