OSX 上的“找不到 pkg-config 脚本”

新手上路,请多包涵

我正在尝试在我的 Mac 上安装一些软件;但是我一直收到同样的错误:

 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 XMEDCON_GLIB_CFLAGS
and XMEDCON_GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details

我不太确定如何将 pkg-config 添加到 PATH 中。我在网上看到(见链接)我应该添加以下内容:

显示如何引导 PATH 变量的链接

export PATH=$PATH:/opt/local/bin     # Fixed typo as mentioned in comment

这是我放置 pkg-config 的地方。尽管每次尝试使用 ./configure 配置文件时,我仍然会不断收到错误消息。任何帮助将不胜感激!

原文由 Shinobii 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1.6k
2 个回答

对我的问题的回答(经过几次谷歌搜索)揭示了以下内容:

 $ curl https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.tar.gz -o pkgconfig.tgz
$ tar -zxf pkgconfig.tgz && cd pkg-config-0.29
$ ./configure && make install

来自以下链接: 上面显示 的链接

感谢大家的评论,并为我对 linux/OSX 的无知感到抱歉!

这样做解决了我上面提到的问题。

原文由 Shinobii 发布,翻译遵循 CC BY-SA 4.0 许可协议

对于 Ubuntu/Debian 操作系统,

apt-get install -y pkg-config

对于 Redhat/Yum 操作系统,

yum install -y pkgconfig

对于 Archlinux 操作系统,

pacman -S pkgconf

原文由 Stephen Hsu 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题