mac安装pkg-config

时间:2021-07-20
本文章向大家介绍mac安装pkg-config,主要包括mac安装pkg-config使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

Mac FFmpeg视频教学教材:https://pan.baidu.com/s/1Rta82eL0xiE_ciliTiA58g 

提取码:g7c4

安装
1.检测环境是否已安装pkg-config

再命令行中输入: pkg-config 若未安装,则提示命令未找到.

2.安装pkg-config

去下载最新的

https://pkg-config.freedesktop.org/releases/

pkg-config-0.28.tar.gz(不可用,解压不了,可以用29或者27版本)

tar -xf pkg-config-0.29.2.tar.gz

cd pkg-config-0.28

./configure --with-internal-glib (不要有多余的空格)

make check

make

install make

在make check时,提示错误 You must have either have gettext support in your C library, or use the GNU gettext library.
这是没有安装gettext

安装gettext
下载地址 http://ftp.gnu.org/pub/gnu/gettext/
去下载最后版本的gettext
解压
cd gettext-0.19.8.1
./configure
make
make install
然后再重新执行安装pkg-config的步骤
如果在安装完之后,使用clang -g -o xxxx xxx.c pkg-config --libs libavformat还是找不到指定的头文件,可以在加上一个参数就可以使用了
clang -g -o xxxx xxx.c pkg-config --cflags --libs libavformat

Mac FFmpeg视频教学教材:https://pan.baidu.com/s/1Rta82eL0xiE_ciliTiA58g 

提取码:g7c4

原文地址:https://www.cnblogs.com/kissme117/p/15035498.html