 <p>Your code gives me the following compiler error, skipping some bits</p> <pre><code>/usr/include/boost/spirit/home/support/action_dispatch.hpp:142:13: error: no matching function for call to ‘action_dispatch&lt;&gt;::do_call( const main()::&lt;lambda(const string&amp;)&gt;&amp;, action_dispatch&lt;&gt;::fwd_tag&lt;std::vector&lt;char&gt;&gt;, ... </code></pre> <p>which boils down to that the argument passed to your lambda is <code>vector&lt;char&gt;</code>, not <code>string</code></p> <p>So, replace <code>string</code> with <code>vector&lt;char&gt;</code>:</p> <pre><code>(+qi::alpha)[[](const std::vector&lt;char&gt;&amp; s) { cout &lt;&lt; std::string(s.begin(), s.end()) &lt;&lt; '\n'; }] </code></pre>