简体   繁体   English

无法构建 Boost Spirit 示例 conjure2

[英]Can't Build Boost Spirit Example conjure2

I am using boost (1.77) spirit qi and lexer.我正在使用 boost (1.77) 灵气和词法分析器。 The error handler expects a stream of characters but I am passing it a stream of tokens, resulting in garbled error messages.错误处理程序需要一个 stream 字符,但我传递给它一个 stream 令牌,导致乱码错误消息。

I believe that the thread below points to a solution:我相信下面的线程指向一个解决方案:

Boost.Spirit: Lex + Qi error reporting Boost.Spirit:Lex + Qi 错误报告

In the comments there, @hkaiser writes:在评论中,@hkaiser 写道:

Just an update: the example has been renamed in SVN to conjure2.只是一个更新:该示例已在 SVN 中重命名为 conjure2。

I just took a look at conjure2.我只是看了一下conjure2。 In an attempt to understand what the program does, I open main.cpp and read the comments, all I find is this:为了了解程序的作用,我打开 main.cpp 并阅读评论,我发现的只是:

Not a calculator anymore, right?不再是计算器了,对吧? :-) :-)

What is that supposed to mean?那应该是什么意思?

I tried to compile the program and it fails with:我试图编译该程序,但它失败了:

"error C2516: 'boost::phoenix::evaluator::impl<const Expr&, 
boost::phoenix::vector2boost::mpl::true_,
boost::phoenix::is_nullary,boost::proto::envns_::empty_env>::result_type': 
is not a legal base class"

What am I doing wrong?我究竟做错了什么?

The fix is to put this at the top of lexer_def.hpp:解决方法是将其放在 lexer_def.hpp 的顶部:

#include <boost/phoenix/operator.hpp>

Stackoverflow tells me that I do not have enough karma to mark my own answer as accepted. Stackoverflow 告诉我,我没有足够的业力将自己的答案标记为已接受。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM