`

pkg-config

阅读更多
pkg-config用法
http://www.sitearchitect.cn/archives/262
概述

返回已安装库文件的元信息。

环境变量:PKG_CONFIG_PATH。pkg-config将在该变量下查找所有的.pc文件。此外,它还会查找/usr/lib/pkgconfig/下的.pc文件。

pkg-config works on multiple platforms: Linux and other UNIX-like operating systems, Mac OS X and Windows. It does not require anything but a reasonably well working C compiler and a C library, but can use an installed glib if that is present. (A copy of glib 1.2.8 is shipped together with pkg-config and this is sufficient for pkg-config to compile and work properly.)

库文件编译完成后,会在{installed_home/lib/}下生成产生一个名为pkgconfig的目录,内含该链接库的.pc文件。这时需要将该文件复制到/usr/lib/pkgconfig/目录中或在环境变量中指定该文件的路径。这样做的目的是为了使依赖此链接库的其它程序能够借助 pkg-config自动加载该库,避免编译期错误。

参数列表
–list 列出所有已安装的共享库
–cflags 列出指定共享库的预处理和编译flag。
–libs 列出指定共享库的链接flag。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics