1

大多数 boost 库都使用 xcode 命令行工具在山狮下成功构建。但在构建过程中收到 4 个错误:

./boost/utility/result_of.hpp:174
./boost/proto/transform/default.hpp:135
./boost/log/detail/light_function_pp.hpp:280
./boost/log/detail/custom_terminal_spec.hpp:54

有没有人面临同样的问题?我该如何解决这些错误?

今天早上刚尝试在Linux下构建并收到同样的错误。使用 gcc 4.1.2。

完整的错误信息:

./boost/utility/result_of.hpp:174: error: invalid use of undefined type 'struct boost::log::v2_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2_mt_posix::ex\
pressions::has_attribute<void> >::result<const boost::log::v2_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2_mt_posix::expressions::has_attribute<void> > \
()(boost::phoenix::vector2<boost::phoenix::vector2<const boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<bo\
ost::log::v2_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2_mt_posix::expressions::has_attribute<void> > >, 0l> >*, const boost::log::v2_mt_posix::attribu\
te_value_set&>&, const boost::phoenix::default_actions&>)>'
./boost/log/detail/unary_function_terminal.hpp:63: error: declaration of 'struct boost::log::v2_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2_mt_posix::e\
xpressions::has_attribute<void> >::result<const boost::log::v2_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2_mt_posix::expressions::has_attribute<void> >\
 ()(boost::phoenix::vector2<boost::phoenix::vector2<const boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<b\
oost::log::v2_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2_mt_posix::expressions::has_attribute<void> > >, 0l> >*, const boost::log::v2_mt_posix::attrib\
ute_value_set&>&, const boost::phoenix::default_actions&>)>'
./boost/log/detail/custom_terminal_spec.hpp:54: error: no type named 'type' in 'struct boost::result_of<const boost::log::v2_mt_posix::expressions::aux::unary_function_termin\
al<boost::log::v2_mt_posix::expressions::has_attribute<void> > ()(boost::phoenix::vector2<boost::phoenix::vector2<const boost::phoenix::actor<boost::proto::exprns_::expr<boos\
t::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2_mt_posix::expressions::has_attr\
ibute<void> > >, 0l> >*, const boost::log::v2_mt_posix::attribute_value_set&>&, const boost::phoenix::default_actions&>)>'
./boost/log/detail/light_function_pp.hpp:77: error: no match for call to '(boost::phoenix::actor<boost::log::v2_mt_posix::expressions::aux::unary_function_terminal<boost::log\
::v2_mt_posix::expressions::has_attribute<void> > >) (const boost::log::v2_mt_posix::attribute_value_set&)'
./boost/phoenix/core/actor.hpp:240: note: candidates are: typename boost::phoenix::result_of::actor<typename boost::mpl::eval_if_c<boost::mpl::or_<boost::phoenix::is_custom_t\
erminal<Expr, void>,mpl_::bool_<boost::is_placeholder<T>::value>,mpl_::bool_<false>,mpl_::bool_<false>,mpl_::bool_<false> >::value, boost::proto::terminal<T>, boost::mpl::ide\
ntity<T> >::type::proto_base_expr, void, void, void, void, void, void, void, void, void, void, void>::type boost::phoenix::actor<Expr>::operator()() [with Expr = boost::log::\
v2_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2_mt_posix::expressions::has_attribute<void> >]
./boost/phoenix/core/actor.hpp:249: note:                 typename boost::phoenix::result_of::actor<typename boost::mpl::eval_if_c<boost::mpl::or_<boost::phoenix::is_custom_t\
erminal<Expr, void>,mpl_::bool_<boost::is_placeholder<T>::value>,mpl_::bool_<false>,mpl_::bool_<false>,mpl_::bool_<false> >::value, boost::proto::terminal<T>, boost::mpl::ide\
ntity<T> >::type::proto_base_expr, void, void, void, void, void, void, void, void, void, void, void>::type boost::phoenix::actor<Expr>::operator()() const [with Expr = boost:\
:log::v2_mt_posix::expressions::aux::unary_function_terminal<boost::log::v2_mt_posix::expressions::has_attribute<void> >]
4

1 回答 1

1

在 Igor R 的提示下,我在 linux 上尝试了 gcc 4.8.1,效果很好。然后我认为 c++11 可能在错误中起作用,并试图找到如何获取 c++11。所以最终我得到了它的工作。XCode 带有两套工具。gcc 前端 + llvm 后端和 clang 前端 + llvm 后端。gcc 版本在我的机器上是旧的( 4.2 ),clang 支持 c++11,所以一旦我使用“toolset=clang”,我就可以成功编译所有内容。

于 2013-08-16T01:42:39.583 回答