我正在尝试在 FreeBSD 上进行源安装(配置、制作),但出现此错误:
error: foo.h: No such file or directory
尽管该文件确实存在于 /usr/local/include/foo.h 所以我猜编译器没有在 /usr/local/include 中查找。
我该如何做才能做到这一点:
LDFLAGS="-L /usr/local/include"
CFLAGS="-I /usr/local/include"
LDFLAGS="-L /usr/local/include"
没有帮助。(安装在 OS 10.7 Tiger 上运行良好)
答案1
看一眼C_INCLUDE_PATH 和 CPLUS_INCLUDE_PATH环境变量:
export C_INCLUDE_PATH=/usr/local/include/:${C_INCLUDE_PATH}
export CPLUS_INCLUDE_PATH=/usr/local/include/:${CPLUS_INCLUDE_PATH}