Boost.Spirit mini_xml2.cpp示例无法由C ++ 11 Boost 1.55编译 [英] Boost.Spirit mini_xml2.cpp example could not be compiled by C++11, Boost 1.55

查看:71
本文介绍了Boost.Spirit mini_xml2.cpp示例无法由C ++ 11 Boost 1.55编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

c ++ 0x编译器无法编译boost.spirit示例 mini_xml2.cpp (并且不是来自c ++ 0x编译器的错误)

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)

错误日志放置在此处.我怀疑问题与非终端属性有关(第159-163行),但我可能是错的.

The error log is placed here. I suspect that problem is related to nonterminal attributes (lines 159-163), but I could be wrong.

  • c ++版本(Ubuntu/Linaro 4.8.1-10ubuntu9)4.8.1
  • 提升版本1.55

我已经在加速跟踪器上创建了问题,但没有答案.

I've created issue at the boost tracker, but have no answer.

有人有同样的错误吗?

已解决:我在此处找到了解决方案.

Solved: I found a solution here.

// Add this macro
#define BOOST_SPIRIT_USE_PHOENIX_V3

推荐答案

如所示,在现代编译器上,您实际上将需要使用Phoenix V3,因为Phoenix V2依赖于 old 结果协议,在更新版本的boost库中,不再总是包含该

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.

另外,在某些编译器(至少是aFAIK)上,默认情况下启用了BOOST_RESULT_OF_USE_DECLTYPE方法,这可能会导致支持库忽略(代价更高)TR1结果协议.

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:

告别凤凰2 2013年12月14日; 3:38 am(Joel de Guzman)
(也博客文章)

Boost C ++ ...经过十多年,我终于从 增强Spirit代码库.我很难过.就像告别一个好朋友.向前 到Phoenix-3.

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.

那是7天前:)

因此,在不久的将来,这个问题将得到解决.

So in the (near) future this problem will have been resolved.

这篇关于Boost.Spirit mini_xml2.cpp示例无法由C ++ 11 Boost 1.55编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆