从github编译c ++ boost库时出错

时间:2013-08-16 00:03:23

标签: c++ git boost git-submodules

我一直在尝试编译从boostorg github repo下载的c ++ boost库,我收到以下错误。

...updating 968 targets...

darwin.compile.c++ bin.v2/libs/atomic/build/darwin-4.2.1/release/threading-multi/lockpool.o
libs/atomic/src/lockpool.cpp:31: error: expected unqualified-id before numeric constant
libs/atomic/src/lockpool.cpp:31: error: expected `)' before numeric constant
libs/atomic/src/lockpool.cpp:55: error: expected `}' at end of input
libs/atomic/src/lockpool.cpp:55: error: expected `}' at end of input
libs/atomic/src/lockpool.cpp:55: error: expected `}' at end of input
libs/atomic/src/lockpool.cpp:55: error: expected `}' at end of input

    "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -dynamic -gdwarf-2 -fexceptions -fPIC  -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_ATOMIC_SOURCE -DNDEBUG  -I"." -c -o "bin.v2/libs/atomic/build/darwin-4.2.1/release/threading-multi/lockpool.o" "libs/atomic/src/lockpool.cpp"

...failed darwin.compile.c++ bin.v2/libs/atomic/build/darwin-4.2.1/release/threading-multi/lockpool.o...
...skipped <pstage/lib>libboost_atomic.dylib for lack of <pbin.v2/libs/atomic/build/darwin-4.2.1/release/threading-multi>lockpool.o...
darwin.compile.c++ bin.v2/libs/system/build/darwin-4.2.1/release/threading-multi/error_code.o
darwin.link.dll stage/lib/libboost_system.dylib
darwin.compile.c++ bin.v2/libs/chrono/build/darwin-4.2.1/release/threading-multi/chrono.o
In file included from /usr/local/include/boost/mpl/or.hpp:43,
                 from /usr/local/include/boost/mpl/logical.hpp:17,
                 from /usr/local/include/boost/chrono/duration.hpp:40,
                 from /usr/local/include/boost/chrono/chrono.hpp:11,
                 from /usr/local/include/boost/chrono/detail/inlined/chrono.hpp:13,
                 from libs/chrono/src/chrono.cpp:14:
/usr/local/include/boost/mpl/aux_/include_preprocessed.hpp:37:90: error: boost/mpl/aux_/preprocessed/gcc/or.hpp: No such file or directory
In file included from /usr/local/include/boost/mpl/and.hpp:42,
                 from /usr/local/include/boost/mpl/logical.hpp:18,
                 from /usr/local/include/boost/chrono/duration.hpp:40,
                 from /usr/local/include/boost/chrono/chrono.hpp:11,
                 from /usr/local/include/boost/chrono/detail/inlined/chrono.hpp:13,
                 from libs/chrono/src/chrono.cpp:14:
/usr/local/include/boost/mpl/aux_/include_preprocessed.hpp:37:90: error: boost/mpl/aux_/preprocessed/gcc/and.hpp: No such file or directory
In file included from /usr/local/include/boost/chrono/chrono.hpp:11,
                 from /usr/local/include/boost/chrono/detail/inlined/chrono.hpp:13,
                 from libs/chrono/src/chrono.cpp:14:
/usr/local/include/boost/chrono/duration.hpp:442: error: ‘and_’ is not a member of ‘boost::mpl’

这正是我的做法:

git clone https://github.com/boostorg/boost.git
cd boost
git submodule init
git submodule update
./boostrap.sh
./b2

知道我缺少什么吗?

1 个答案:

答案 0 :(得分:3)

github存储库似乎是正在进行的将模块化模块化为单独的git存储库的努力的一部分。它似乎仍有一些问题。如果你想构建最新的开发代码,我会使用官方的svn trunk:

svn co http://svn.boost.org/svn/boost/trunk boost

如果您只想要最新版本(1.54)来源,可以下载here

但如果您特别需要一个git镜像,this似乎是一个最新的增强中继镜像。