Linux glib需要pkg-config和pkg-config需要glib?

我尝试安装udev。 udev在./configure期间给我一个错误

--exists: command not found configure: error:
pkg-config and "glib-2.0 >= 2.16" not found, please set GLIB_CFLAGS and GLIB_LIBS
to the correct values or pass --with-internal-glib to configure 

好的,pkg-config和glib-2.0缺少。

起初我试图安装pkg-config。我收到了这个消息:

checking whether to list both direct and indirect dependencies... no
checking for Win32... no
checking if internal glib should be used... no
checking for pkg-config... no
./configure: line 13557: --exists: command not found
configure: error: pkg-config and "glib-2.0 >= 2.16" not found,
please set GLIB_CFLAGS and GLIB_LIBS to the correct values or 
pass --with-internal-glib to configure

好的,我解释说,那glib是缺失的。

下一步安装Glib。

我收到了这个消息:

configure: error: in `/root/glib-2.33.3':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

但我现在很困惑
他们需要彼此吗?
我的错误是什么?

最佳答案
正如您已经观察到的,pkg-config和glib之间确实存在循环依赖关系。要打破它,pkg-config的source code包含一个glib的版本,这足以编译它。这应该破坏依赖关系周期。

尝试使用–with-internal-glib配置pkg-config。

转载注明原文:Linux glib需要pkg-config和pkg-config需要glib? - 代码日志