Boost.Spirit mini_xml2.cpp例如coud不是由C ++ 11编译,提升1.55 [英] Boost.Spirit mini_xml2.cpp example coud not be compiled by C++11, Boost 1.55
问题描述
的C ++ 0x编译器编译失败boost.spirit例子的 mini_xml2.cpp (没有从错误中没有的C ++ 0x编译器)
$> C ++ -std =的C ++ 0x mini_xml2.cpp(错误)
$> C ++ mini_xml2.cpp(没有错误)
错误日志放在这里 。我怀疑问题是有关非终端的属性(线159-163),但我可能是错的。
- C ++版本(Ubuntu的/ Linaro的4.8.1-10ubuntu9)4.8.1
- 升压版本1.55
我创建问题在升压跟踪,但都无人接听
没有任何人有同样的错误?
解决:我发现了一个解决方案,这里。
//添加这个宏
#定义BOOST_SPIRIT_USE_PHOENIX_V3
如图所示,在现代的编译器,你将真正需要使用凤凰V3,凤凰V2依赖的老的协议结果-的,这提振库的更新只是不总是包含了
此外在某些编译器(据我所知,至少铛)的BOOST_RESULT_OF_USE_DECLTYPE方法是默认开启的,这可能会导致支持库省略(更昂贵的)协议TR1结果-的。
好消息是,在我们的 标志着这对用户列表 作为一个经常性绊脚石,官方的决定是在这里:
告别凤凰-2 2013年12月14日;上午03点38分(乔尔·古斯曼)
(也博客文章)
升压C ++ ...十多年后,我终于退休了凤凰-2从
提振精神code基地。我很难过。这就像送别一个好朋友。向前
凤凰-3。
块引用>这短短7天前:)
所以在(近)的未来这个问题都将得到解决。
c++0x compiler fails to compile boost.spirit example mini_xml2.cpp (and no errors from not c++0x compiler)
$> c++ -std=c++0x mini_xml2.cpp (errors) $> c++ mini_xml2.cpp (no errors)
The error log is placed here. I suspect that problem is related to nonterminal attributes (lines 159-163), but I could be wrong.
- c++ version (Ubuntu / Linaro 4.8.1-10ubuntu9) 4.8.1
- Boost version 1.55
I've created issue at the boost tracker, but have no answer.
Does anybody have the same errors?
Solved: I found a solution here.
// Add this macro #define BOOST_SPIRIT_USE_PHOENIX_V3
解决方案As indicated, on modern compilers you will actually need to use Phoenix V3, as Phoenix V2 relies on the old result-of protocol, which in newer versions of boost libraries just isn't always included anymore.
Additionally on some compilers (AFAIK at least clang) the BOOST_RESULT_OF_USE_DECLTYPE approach is enabled by default, which may cause the supporting libraries to omit the (more costly) TR1 result-of protocol.
The good news is, after we signaled this on the user list as a recurring stumbling block, the official decision is here:
Farewell Phoenix-2 Dec 14, 2013; 3:38am (Joel de Guzman)
(also blog post)Boost C++... After more than a decade, I finally retired Phoenix-2 from the Boost Spirit code base. I feel sad. It's like farewell to a good friend. Onwards to Phoenix-3.
That's just 7 days ago :)
So in the (near) future this problem will have been resolved.
这篇关于Boost.Spirit mini_xml2.cpp例如coud不是由C ++ 11编译,提升1.55的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!