[boost::fusion v2 and xpressive] versioning conflicts...
Hello, I am using fusion v2 in my project and first would like to thank for the great lib. I installed this lib into the boost/fusion directory. Today I started using xpressive lib (which is also a great one!!!). Unfortunately xpressive broke my compilation, because it includes things from boost/spirit/fusion and my code includes headers from boost/fusion. Now my assumption: AFAIK spirit/fusion contains version 1. Since I would like to use version 2 I can not simply copy it into the spirit directory, since it can break other things like wave. Is it correct? If yes, does anyone have suggestions on how I should deal with this issues? Detailed compiler errors: E:\libraries\boost\include\boost/fusion/support/detail/access.hpp(24) : error C2953: 'boost::fusion::detail::ref_result' : class template has already been defined E:\libraries\boost\include\boost/spirit/fusion/detail/access.hpp(23) : see declaration of 'boost::fusion::detail::ref_result' E:\libraries\boost\include\boost/fusion/support/detail/access.hpp(34) : error C2953: 'boost::fusion::detail::cref_result' : class template has already been defined E:\libraries\boost\include\boost/spirit/fusion/detail/access.hpp(29) : see declaration of 'boost::fusion::detail::cref_result' E:\libraries\boost\include\boost/fusion/support/detail/access.hpp(40) : error C2953: 'boost::fusion::detail::non_ref_parameter' : class template has already been defined E:\libraries\boost\include\boost/spirit/fusion/detail/access.hpp(37) : see declaration of 'boost::fusion::detail::non_ref_parameter' E:\libraries\boost\include\boost/fusion/support/detail/access.hpp(52) : error C2953: 'boost::fusion::detail::call_param' : class template has already been defined E:\libraries\boost\include\boost/spirit/fusion/detail/access.hpp(43) : see declaration of 'boost::fusion::detail::call_param' With Kind Regards, Ovanes Markarian
Hello,
I am using fusion v2 in my project and first would like to thank for the great lib. I installed this lib into the boost/fusion directory.
Today I started using xpressive lib (which is also a great one!!!). Unfortunately xpressive broke my compilation, because it includes things from boost/spirit/fusion and my code includes headers from boost/fusion. Now my assumption: AFAIK spirit/fusion contains version 1. Since I would like to use version 2 I can not simply copy it into the spirit directory, since it can break other things like wave. Is it correct? If yes, does anyone have suggestions on how I should deal with this issues?
I'm not using boost fusion in my projects but as a C++ programmer first thing I would try do is renaming fusion v2 namespace right after including its headers and only then include xpressive's ones. Of course as a result using fusion v2 will require explicit namespace specification. -- Constantin Bryzgalin http://www.oneclicktools.com
On Thu, August 9, 2007 19:09, Constantin Bryzgalin wrote:
Hello,
I am using fusion v2 in my project and first would like to thank for the great lib. I installed this lib into the boost/fusion directory.
Today I started using xpressive lib (which is also a great one!!!). Unfortunately xpressive broke my compilation, because it includes things from boost/spirit/fusion and my code includes headers from boost/fusion. Now my assumption: AFAIK spirit/fusion contains version 1. Since I would like to use version 2 I can not simply copy it into the spirit directory, since it can break other things like wave. Is it correct? If yes, does anyone have suggestions on how I should deal with this issues?
I'm not using boost fusion in my projects but as a C++ programmer first thing I would try do is renaming fusion v2 namespace right after including its headers and only then include xpressive's ones. Of course as a result using fusion v2 will require explicit namespace specification.
-- Constantin Bryzgalin http://www.oneclicktools.com
Constantin, many thanks for you advice. This is what I already did, but I would like to have some maintanable standard solution. This thing goes a little bit deeper as simple namespace renaming: As I can see different versions have different header guards (so v2 and v1 can be included in one file). May be it is good, may be bad. It depends on the situation a programmer will trap into... ;) But anyway thanks for your help. With Kind Regards, Ovanes Markarian
Ovanes Markarian wrote:
Hello,
I am using fusion v2 in my project and first would like to thank for the great lib. I installed this lib into the boost/fusion directory.
Today I started using xpressive lib (which is also a great one!!!). Unfortunately xpressive broke my compilation, because it includes things from boost/spirit/fusion and my code includes headers from boost/fusion. Now my assumption: AFAIK spirit/fusion contains version 1. Since I would like to use version 2 I can not simply copy it into the spirit directory, since it can break other things like wave. Is it correct? If yes, does anyone have suggestions on how I should deal with this issues?
I can infer from this that you're using boost 1.34.1 or earlier, and you've copied boost.fusion from svn HEAD into the tree, right? Xpressive isn't expecting to find Fusion v2 in Boost 1.34, hence the problem. You'll need to hack on xpressive a bit to make this work. In xpressive_fwd.hpp, you should add something like #if BOOST_VERSION >= 103500 #ifndef BOOST_XPRESSIVE_FUSION_V2 #define BOOST_XPRESSIVE_FUSION_V2 #endif #endif Then everywhere xpressive conditionally includes fusion v1 or v2, you should check BOOST_XPRESSIVE_FUSION_V2 instead of the boost version. You'll need to do something similar in proto_fwd.hpp (#define BOOST_PROTO_FUSION_V2) and all of proto's headers. Then you'll be ableto force the issue by compiling with BOOST_XPRESSIVE_FUSION_V2 and BOOST_PROTO_FUSION_V2 defined. If you do all this and submit a patch, I'll accept it. -- Eric Niebler Boost Consulting www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com
participants (3)
-
Constantin Bryzgalin
-
Eric Niebler
-
Ovanes Markarian