
On 07/19/2012 04:39 PM, Andrey Semashev wrote:
Hi,
Recently I tried to port my code to Boost.Spirit v2 and Boost.Phoenix v3. After including the following headers:
#include<boost/phoenix/core.hpp> #include<boost/spirit/include/qi_core.hpp>
I got the following error:
In file included from ./boost/spirit/home/phoenix/core.hpp:13:0, from ./boost/spirit/include/phoenix_core.hpp:14, from ./boost/spirit/home/support/make_component.hpp:15, from ./boost/spirit/home/support/meta_compiler.hpp:20, from ./boost/spirit/home/qi/domain.hpp:15, from ./boost/spirit/home/qi/parser.hpp:15, from ./boost/spirit/include/qi_core.hpp:16, from libs/log/src/text_file_backend.cpp:51: ./boost/spirit/home/phoenix/core/actor.hpp:46:16: error: redefinition of ‘struct boost::phoenix::detail::error_expecting_arguments’ ./boost/phoenix/core/actor.hpp:41:16: error: previous definition of ‘struct boost::phoenix::detail::error_expecting_arguments’ ./boost/spirit/home/phoenix/core/actor.hpp:65:12: error: redefinition of ‘struct boost::phoenix::actor<Expr>’ ./boost/phoenix/core/actor.hpp:161:12: error: previous definition of ‘struct boost::phoenix::actor<Expr>’
I take it the problem is that Boost.Spirit always include Phoenix v2 which causes name clashes with v3.
Is this a known problem? Shouldn't Boost.Spirit include Phoenix v3 headers instead? I can see v3 redirects includes to v2 if BOOST_PHOENIX_USE_V2_OVER_V3 macro is defined (BTW, there's an error in boost/phoenix/stl.hpp: BOOST_PHOENIX_USE_V2 macro is checked instead).
This happens in the release branch. You should define BOOST_SPIRIT_USE_PHOENIX_V3 instead, as documented here: http://www.boost.org/doc/libs/1_50_0/libs/spirit/doc/html/spirit/what_s_new/... This probably needs a bit more exposure, the macros defined in phoenix are a leftover from earlier days and should be ignored.
_______________________________________________ Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost