Re: Linking problem with X3

Joel de Guzman <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 10/03/2016 6:30 PM, Mikael Asplund wrote:
> Hi!
>
> If I take the x3 calc9 example in Boost 1.60 and change in config.hpp from:
>
> typedefx3::with_context<error_handler_tag, std::/reference_wrapper/<error_handler_type>
> const, phrase_context_type>::/type/
>
> ...to:
>
> typedefx3::with_context<error_handler_tag, std::/reference_wrapper/<error_handler_type>
> const, x3::unused_type>::/type/
>
> ...and also change in main.cpp:
>
> boolsuccess= phrase_parse(iter, end, parser, /space/, ast);
>
> ...to:
>
> boolsuccess= parse(iter, end, parser, ast);
>
> ...I get a link problem:
>
[...]
>
> The question is why is this screws up the linking (/BOOST_SPIRIT_INSTANTIATE/ macro seems
> to be instantiating the needed type)?
>
> Anyone out there with more experience with this? I'm utterly confused, and I've been
> trying what I can think of for days!

     typedef x3::with_context<
         error_handler_tag
       , std::reference_wrapper<error_handler_type> const>::type
     context_type;

(i.e. don't inject the x3::unused_type context)

Regards,
-- 
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.