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