Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#10040 closed Bugs (wontfix)

Incompatibility headers spirit::qi and log

Reported by: wixdesq@… Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

Hi,

I'm using msvc 12.0 with boost built in amd 64 mode. I get an error when the headers :

#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_numeric.hpp>

are present with these headers :

#include <boost/log/core.hpp>
#include <boost/log/expressions.hpp>

Well, I wrote my little configuration parser using spirit::qi, and it was fine. It worked nicely and converted my strings into integers when needed. But today I wanted to add a log system to my code, and wanted to use boost::log. I followed the tutorial, and only some headers worked on their own :

#include <boost/log/sources/severity_logger.hpp>
#include <boost/log/trivial.hpp>

The output of cl.exe : (sorry, it's in french)

1>  main.cpp
1>D:\Code\lib\boost_1_55_0\boost/phoenix/version.hpp(16): warning C4005: 'BOOST_PHOENIX_VERSION: redéfinition de macro
1>          D:\Code\lib\boost_1_55_0\boost/spirit/home/phoenix/version.hpp(16) : voir la définition précédente de 'BOOST_PHOENIX_VERSION'
1>D:\Code\lib\boost_1_55_0\boost/phoenix/core/limits.hpp(26): warning C4005: 'PHOENIX_LIMIT: redéfinition de macro
1>          D:\Code\lib\boost_1_55_0\boost/spirit/home/phoenix/core/limits.hpp(13) : voir la définition précédente de 'PHOENIX_LIMIT'
1>D:\Code\lib\boost_1_55_0\boost/phoenix/core/is_actor.hpp(28): error C2977: 'boost::phoenix::is_actor: nombre d'arguments modèle trop élevé
1>          D:\Code\lib\boost_1_55_0\boost/spirit/home/phoenix/core/is_actor.hpp(23) : voir la déclaration de 'boost::phoenix::is_actor'
1>D:\Code\lib\boost_1_55_0\boost/phoenix/core/is_actor.hpp(28): fatal error C1903: impossible de récupérer à partir des erreurs précédentes ; arrêt de la compilation
1>  log.cpp
1>D:\Code\lib\boost_1_55_0\boost/proto/operators.hpp(295): warning C4180: qualificateur appliqué au type fonction n'a pas de sens ; ignoré
1>          src\log.cpp(114) : voir la référence à l'instanciation de la fonction modèle 'const boost::phoenix::actor<Expr> boost::proto::exprns_::operator <<<const boost::phoenix::actor<boost::proto::exprns_::expr<Tag,Args,2>>,std::ios_base&(std::ios_base &)>(Left &&,Right (__cdecl &&))' en cours de compilation
1>          with
1>          [
1>              Expr=boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<boost::phoenix::argument<2>>,0>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::ios_base &(__cdecl *)(std::ios_base &)>,0>>>,2>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::_Smanip<std::streamsize>>,0>>>,2>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::_Fillobj<char>>,0>>>,2>>,boost::log::v2s_mt_nt5::expressions::attribute_actor<unsigned int,boost::log::v2s_mt_nt5::fallback_to_none,tag::line_id,boost::phoenix::actor>>,2>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::ios_base &(__cdecl &)(std::ios_base &)>,0>>>,2>
1>  ,            Tag=boost::proto::tagns_::tag::shift_left
1>  ,            Args=boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<boost::phoenix::argument<2>>,0>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::ios_base &(__cdecl *)(std::ios_base &)>,0>>>,2>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::_Smanip<std::streamsize>>,0>>>,2>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::_Fillobj<char>>,0>>>,2>>,boost::log::v2s_mt_nt5::expressions::attribute_actor<unsigned int,boost::log::v2s_mt_nt5::fallback_to_none,tag::line_id,boost::phoenix::actor>>
1>  ,            Left=const boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left,boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<boost::phoenix::argument<2>>,0>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::ios_base &(__cdecl *)(std::ios_base &)>,0>>>,2>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::_Smanip<std::streamsize>>,0>>>,2>>,boost::phoenix::actor<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<std::_Fillobj<char>>,0>>>,2>>,boost::log::v2s_mt_nt5::expressions::attribute_actor<unsigned int,boost::log::v2s_mt_nt5::fallback_to_none,tag::line_id,boost::phoenix::actor>>,2>>
1>  ,            Right=std::ios_base &(std::ios_base &)
1>          ]

I tried to find out what was wrong with Phoenix.. I don't really know how it works behing the scene, but I read on the web Log is using Phoenix3 .. Maybe qi is not using the same version and something goes wrong when including both together ... Just making hypothesis ... Anyway this is, I think, a bug.

I added my CL.read.1.log, which contains all the files retreived by msvc during the building process.

Attachments (1)

CL.read.1.tlog.7z (20.0 KB ) - added by wixdesq@… 8 years ago.
Included file listing

Download all attachments as: .zip

Change History (4)

by wixdesq@…, 8 years ago

Attachment: CL.read.1.tlog.7z added

Included file listing

comment:1 by Andrey Semashev, 8 years ago

Resolution: wontfix
Status: newclosed

Yes, Boost.Log uses Boost.Phoenix v3. It is incompatible with Boost.Phoenix v2 (which resides in boost/spirit/home/phoenix and AFAIK is deprecated). You cannot include both Boost.Phoenix v3 and v2 in the same project, you'll have to choose one. There's nothing I can do about it in Boost.Log.

Boost.Spirit is compatible with Boost.Phoenix v3, but you have to define BOOST_SPIRIT_USE_PHOENIX_V3=1 macro when compiling your code. If you use Boost.Phoenix v2 in your code then you might have to do some adjustments to make it compatible with v3 (and change includes, naturally).

comment:2 by Benjamin B. <wixdesq@…>, 8 years ago

You're right. BOOST_SPIRIT_USE_PHOENIX_V3=1 did it for me. But why this (deprecated) api is still used ? Are they in the process of upgrading spirit's phoenix default version ?

comment:3 by Andrey Semashev, 8 years ago

You'll have to ask Boost.Spirit developers about that. My guess is for backward compatibility. I wouldn't mind if v3 was the default.

Note: See TracTickets for help on using tickets.