我无法安装依赖于依赖pcre.h的程序的麻烦.我已经安装到/ opt / local / include,但是C编译器看不到它,因此给了我:
error: pcre.h: No such file or directory
我已经通过编写一个试图包含它的hello world程序来证实这一点:
#include <pcre.h> #include <stdio.h> int main(void) { printf("hello,world\n"); return 0; }
除非我将路径指定为< / opt /local/include/pcre.h\u0026gt ;. 我希望C编译器默认找到它,但我不知道这是在哪里配置的.选项卡完成没有显示任何HEADER_PATH环境变量,我找不到类似于XCode不是特定的任何东西.但是,我使用的是Mac OSX Snow Leopard,这样做有所不同.
解决方法
在命令行中使用-I / opt / local / include,或在环境中使用C_INCLUDE_PATH = / opt / local / include.