0

我决定学习 Boost Spirit 并开始在这里学习外观。但是,我很失望,因为第一个示例calc1.cpp没有在我的计算机上编译,它给出了以下错误消息:

calc1.cpp: In constructor ‘client::calculator<Iterator>::calculator()’:
calc1.cpp:43:13: error: ‘uint_type’ is not a member of ‘client::qi’
calc1.cpp:43:27: error: expected ‘;’ before ‘uint_’
calc1.cpp:60:17: error: ‘uint_’ was not declared in this scope
calc1.cpp:60:17: note: suggested alternatives:
/usr/include/boost/spirit/home/support/common_terminals.hpp:134:1: note:   ‘boost::spirit::uint_’
/usr/include/boost/spirit/home/support/common_terminals.hpp:134:1: note:   ‘boost::spirit::tag::uint_’
/usr/include/boost/spirit/home/support/common_terminals.hpp:134:1: note:   ‘boost::spirit::uint_’

我添加了这样的一行,但这不是解决方案:

#include <boost/spirit/home/support/common_terminals.hpp>

我该怎么办?提前致谢。

4

1 回答 1

3

您正在尝试在 Boost 1.46.1 的安装上使用 Boost 1.51.0 中的示例。

而不是你正在使用的演示,试试这个: http: //www.boost.org/doc/libs/1_46_1/libs/spirit/example/qi/calc1.cpp

于 2012-10-17T21:32:51.563 回答