Note that there are some explanatory texts on larger screens.

plurals
  1. POBoost Spirit v2 gcc compilation error which does not show up using msvc
    text
    copied!<p>I recently wrote some spirit parsing code in windows, which I recently have tried to get build on an ubuntu box and have ran into a compilation error that I am struggling with.</p> <p>After some hacking and slashing, I have managed to come up with this example code snippet which exhibits the same behavior:</p> <pre><code>struct FooParser : spirit::qi::grammar&lt; std::string::const_iterator, double(), spirit::qi::ascii::space_type&gt; { FooParser() : FooParser::base_type(a_rule) { using namespace boost::spirit::qi; a_rule = double_; } spirit::qi::rule&lt; string::const_iterator, double(), spirit::qi::ascii::space_type&gt; a_rule; }; </code></pre> <p>which is then passed to a phrase_parse like so:</p> <pre><code>double result; std::string txt; FooParser foobar; //... if(phrase_parse(txt.begin(), txt.end(), foobar, space, result)) { //do something } </code></pre> <p>And when compiled, generates the following error:</p> <pre><code>boost/spirit/home/qi/reference.hpp:41: error: no matching function for call to ‘boost::spirit::qi::rule&lt;__gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, double(), boost::proto::exprns_::expr&lt;boost::proto::tag::terminal, boost::proto::argsns_::term&lt;boost::spirit::tag::char_code&lt;boost::spirit::tag::space, boost::spirit::char_encoding::ascii&gt; &gt;, 0l&gt;, boost::fusion::unused_type, boost::fusion::unused_type&gt;::parse(__gnu_cxx::__normal_iterator&lt;char*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;&amp;, const __gnu_cxx::__normal_iterator&lt;char*, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;&amp;, const boost::fusion::unused_type&amp;, const boost::spirit::qi::char_class&lt;boost::spirit::tag::char_code&lt;boost::spirit::tag::space, boost::spirit::char_encoding::ascii&gt; &gt;&amp;, double&amp;) const’ </code></pre> <p>The thing that I find frustrating is that visual studio seems more than happy to compile and run the code. I am hoping that the wise internets can show me where I have erred.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload