源码编译rrdtool提示找不到xxx.pc类问题处理

2022-04-26 00:00:00 专区 订阅 付费 编译 原文

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
————————————————
版权声明:本文为CSDN博主「sunshine185」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/yyj185/article/details/73504260

相关文章