为什么brew没有正确编译boost

Why is brew not compiling boost correctly?

本文关键字:编译 boost brew 为什么      更新时间:2023-10-16

我在Mac OSX Yosemite 10.10.3上,brew install boost没有正确编译boost。例如,运行

g++ -I/usr/local/Cellar/include -x c++ -E /dev/null -include boost/version.hpp      && echo SUCCESS: 

给我

# 1 "/dev/null"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 326 "<built-in>" 3
# 1 "<command line>" 1
In file included from <built-in>:326:
<command line>:1:10: fatal error: 'boost/version.hpp' file not found
#include "boost/version.hpp"
         ^
# 1 "<built-in>" 2
# 1 "/dev/null" 2

我注意到,通过Brew安装获得的目录结构与此处列出的目录结构有很大不同:http://www.boost.org/doc/libs/1_35_0/more/getting_started/unix-variants.html也许这不会影响任何事情。

命令应该改为

g++ -I/usr/local/include -x c++ -E /dev/null -include boost/version.hpp && echo SUCCESS