我读过几篇关于此的文章。
但他们没有从我这里解决。
请查看信息
brew install pkg-config
然后完成安装
Rangers-iMac:dash ranger$ which pkg-config
/usr/local/bin/pkg-config
这意味着 pkg-config 已安装。
Rangers-iMac:dash ranger$ ./configure
...
checking for exit in -lboost_chrono-mt... yes
checking whether the Boost::Unit_Test_Framework library is available... yes
checking for dynamic linked boost test... yes
configure: error: pkg-config not found.
这意味着configure找不到pkg-config。
我认为问题出在 PATH 中,但我不知道如何解决它。
项目的配置脚本似乎对 pkg-config 的位置做出了假设。幸运的是,您可以使用 PKG_CONFIG 环境变量覆盖它。
export PKG_CONFIG=/path/to/pkg-config
然后再次
./configure
。
我使用的是eclipse CDT,在项目>属性>c/C++构建>环境中,添加:
variable:PKG_CONFIG
value:/usr/local/bin/pkg-config
然后清理项目,一切顺利。 对于其他一些包含未解决的问题,可以在项目>属性>c/C++常规>路径和符号:GNU C++>包含中添加目录
您可以通过自制程序安装pkg-config:
brew install pkg-config