简体   繁体   中英

Boost 1.54 build error under OS X 10.8.4 Mountain Lion

Most of the boost libraries built successfully under mountain lion using xcode command line tool. But received 4 errors during built:

./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

Does anyone face the same issue? And how can I resolve the errors?

Just tried to build under Linux this morning and received the same error. Using gcc 4.1.2.

Full error messages:

./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> >]

With the hint from Igor R, I tried gcc 4.8.1 on linux which works well. Then I think c++11 might play a role in the errors and tried to find how to get c++11. So eventually I got it to work. XCode comes with two sets of tool. gcc front-end + llvm backend and clang front-end + llvm backend. The gcc version is old as on my machine ( 4.2 ), the clang supports c++11, so once I use "toolset=clang", I can compile everything successfully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM