pkg-config找不到.pc文件,尽管它们位于路径中 [英] pkg-config cannot find .pc files although they are in the path
问题描述
我在Mac OSX-Lion上看到pkg-config的一个奇怪问题.为下载的模块运行python安装程序时,出现以下错误:
I am seeing a strange issue with pkg-config on Mac OSX-Lion. When running the python setup for module that I downloaded I receive the following error:
aspen:python toddysm$ sudo ./setup.py install
Password:
`pkg-config --libs --cflags cld` returns in error:
Package cld was not found in the pkg-config search path.
Perhaps you should add the directory containing `cld.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cld' found
The `cld` C++ library is absent from this system. Please install it.
但是,当检查/usr/local/lib文件夹时,我看到了libs和.pc文件位于pkgconfig子文件夹中
However when checking in the /usr/local/lib folder I see the libs and the .pc file is in the pkgconfig subfolder
aspen:~ toddysm$ cd /usr/local/lib/
aspen:lib toddysm$ ls -al
total 2640
drwxr-xr-x 6 root wheel 204 Jul 2 17:38 .
drwxr-xr-x 9 root wheel 306 Jul 2 15:17 ..
-rwxr-xr-x 1 root wheel 1339516 Jul 2 17:38 libcld.0.dylib
lrwxr-xr-x 1 root wheel 14 Jul 2 17:38 libcld.dylib -> libcld.0.dylib
-rwxr-xr-x 1 root wheel 918 Jul 2 17:38 libcld.la
drwxr-xr-x 3 root wheel 102 Jul 2 17:38 pkgconfig
aspen:lib toddysm$ cd pkgconfig/
aspen:pkgconfig toddysm$ ls -al
total 8
drwxr-xr-x 3 root wheel 102 Jul 2 17:38 .
drwxr-xr-x 6 root wheel 204 Jul 2 17:38 ..
-rw-r--r-- 1 root wheel 279 Jul 2 17:38 cld.pc
使用命令行将PKG_CONFIG_PATH设置为指向/usr/local/lib/并没有帮助.出于某种原因将其设置为〜/.bash_profile会使pkg-config无法识别为命令.
Setting PKG_CONFIG_PATH to point to /usr/local/lib/ using the command line doesn't help. Setting it into ~/.bash_profile for some reason makes pkg-config unrecognizable as command.
我的假设是我缺少某种依赖性,但不确定是什么.在Linux上尝试相同操作时,我缺少了Python Dev软件包python2.7-dev,但是我不确定如何在Mac上进行检查(是否存在).
My assumption is that I am missing some dependency but not sure what. When trying the same on Linux I was missing the Python Dev package python2.7-dev but I am not sure how to check for this on Mac (whether is there or not).
任何帮助将不胜感激.
推荐答案
默认情况下,您可以使用以下命令列出pkg-config
查找的目录:
You can list the directories pkg-config
looks in by default using:
pkg-config --variable pc_path pkg-config
PKG_CONFIG_PATH
需要在变量后附加完整的/usr/local/lib/pkgconfig
路径名.
PKG_CONFIG_PATH
needs the full /usr/local/lib/pkgconfig
pathname appended to the variable.
这篇关于pkg-config找不到.pc文件,尽管它们位于路径中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!