pkg-config

It also installs files for pkg-config to make it easier to detect

-- Installing: /usr/lib/pkgconfig/libcjson.pc

pkg-config

  • 在安装cjson1.5.5的时候出现了这些话
$man pkg-config
pkg-config - Return metainformation about installed libraries


cc program.c $(pkg-config --cflags --libs gnomeui)
gcc -c `pkg-config --cflags glib-2.0` sample.c


pkg-config looks in /usr/lib/pkgconfig, /usr/share/pkgconfig,/usr/local/lib/pkgconfig and /usr/local/share/pkgconfig

PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig:$PKG_CONFIG_PATH


The package name specified on the pkg-config command line is defined to be the name of the metadata file, minus the .pc extension.
In addition to specifying a package name on the command line, the full path to a given .pc file may be given instead.

使用

一般编译源码的时候会生成 .pc文件,然后安装的时候安装到相应目录.

使用的话,像下面这样子就可以了,但是有时候会出现一些问题,例如,pkg-config --cflags libcjson 显示为空,pkg-config --libs libcjson 无问题

cc program.c $(pkg-config --cflags --libs gnomeui)
gcc -c `pkg-config --cflags glib-2.0` sample.c
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值