安装
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
解决办法
如报错提示所述,加上:--with-internal-glib
即
./configure --with-internal-glib
参考链接:
http://stackoverflow.com/questions/12262925/linux-glib-needs-pkg-config-and-pkg-config-needs-glib
http://blog.csdn.net/ldl22847/article/details/8575149
————————————————
版权声明:本文为CSDN博主「厚德.」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qqqq245425070/article/details/84312783