3
不能编译任何example 在Ubuntu 16.04精神X3:不能编译在Ubuntu 16.04任何例子
$ g++ -std=c++14 main.cpp
In file included from /usr/include/boost/spirit/home/x3/nonterminal.hpp:14:0,
from /usr/include/boost/spirit/home/x3.hpp:20,
from main.cpp:23:
main.cpp:226:9: error: ‘client::calculator_grammar::parse_rule’ declared as an ‘inline’ variable
BOOST_SPIRIT_DEFINE(
^
main.cpp:226:9: error: expected ‘)’ before ‘rule_’
BOOST_SPIRIT_DEFINE(
^
main.cpp:226:9: error: expected primary-expression before ‘&’ token
BOOST_SPIRIT_DEFINE(
^
main.cpp:226:9: error: ‘first’ was not declared in this scope
BOOST_SPIRIT_DEFINE(
^
这是一种精神:: X3的错误?
是的,[this](https://github.com/boostorg/spirit/blob/boost-1.64.0/example/x3/calc/calc5.cpp)是OP想要的例子([diff]( https://www.diffchecker.com/LZQmA4NQ))。 – llonesmiz
@llonesmiz啊,显然。我从来没有检查过链接:) – sehe