【发布时间】:2016-03-30 05:48:01
【问题描述】:
我在 OS X 上通过 brew 安装了 boost 1.60,El Capitan 10.11.4
> brew install boost
==> Downloading https://homebrew.bintray.com/bottles/boost-1.60.0_1.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring boost-1.60.0_1.el_capitan.bottle.tar.gz
???? /usr/local/Cellar/boost/1.60.0_1: 11,139 files, 436.0M
但是,在我的 clang 工具链中使用 <boost/...> 并不容易。它根本找不到 boost 目录。
> make
Scanning dependencies of target foo
[ 50%] Building CXX object CMakeFiles/foo.dir/foo.cpp.o
foo.cpp:16:10: fatal error: 'boost/type_index.hpp' file not found
#include <boost/type_index.hpp>
^
1 error generated.
我知道我必须设置一些环境变量或添加-I。但我想看看解决这个问题的最佳方法。
【问题讨论】:
-
是
/usr/local/Cellar' in your$PATH`?输入 echo $PATH 找出