Using pkg-config to detect libraries installed using homebrew

http://flummox-engineering.blogspot.com/2015/01/osx-cmake-no-package-gnutls-found.html



Using pkg-config to detect libraries installed using homebrew

If you are trying to link to a library installed via Homebrew, I suggest  reading this article.

Whilst trying to build  OpenVAS on OSX, I encounter this message. 



Package gnutls was not found in the pkg-config search path.
Perhaps you should add the directory containing `gnutls.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gnutls' found
Package gnutls was not found in the pkg-config search path.
Perhaps you should add the directory containing `gnutls.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gnutls' found


This is surprising because I have the latest version of GnuTLS installed via Homebrewpkg-config cannot find it though


$ pkg-config --cflags gnutls

Package gnutls was not found in the pkg-config search path.
Perhaps you should add the directory containing `gnutls.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gnutls' found

Add the pkg-config configuration file /usr/local/opt/gnutls/lib/pkgconfig/gnutls.pc to PKG_CONFIG_PATH and now pkg-config will be able to locate it


$ PKG_CONFIG_PATH=/usr/local/opt/gnutls/lib/pkgconfig pkg-config --cflags gnutls
Package libtasn1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libtasn1.pc'
to the PKG_CONFIG_PATH environment variable

Not so fast! GNuTLS itself has a couple of dependencies. You can either install them:


$ brew install libtasn1 p11-kit


Or in my case they had been installed, but not properly linked by homebrew:


$ brew link libtasn1 p11-kit



Now pkg-config can locate the GnuTLS library and header files


$ PKG_CONFIG_PATH=/usr/local/opt/gnutls/lib/pkgconfig pkg-config --cflags gnutls
-I/usr/local/Cellar/gnutls/3.1.10/include -I/usr/local/Cellar/libtasn1/4.2/include -I/usr/local/Cellar/p11-kit/0.18.4/include/p11-kit-1 








评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值