Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples are outdated, do not build due to API changes in version 1.67.0 #12

Open
Xeverous opened this issue Aug 27, 2018 · 12 comments
Open

Comments

@Xeverous
Copy link

From Spirit changelog:

Removed with_context PR#239.

Here are links to related changes that break compilation:

@mjcaisse
Copy link
Member

I haven't looked at this project for some time and I guess I hadn't considered that other people might be using it. Thank you for bringing this to my attention. This issue will result in some changes about how I maintain code that was written for a presentation.

@Xeverous
Copy link
Author

Xeverous commented Aug 27, 2018 via email

@djowel
Copy link
Contributor

djowel commented Aug 27, 2018

Perhaps it's best to move them to boost. I'll see what I can do.

@djowel
Copy link
Contributor

djowel commented Aug 27, 2018

@Xeverous do you think you can make a PR on the changes required?

@Xeverous
Copy link
Author

Xeverous commented Aug 28, 2018

Actually not. I tried building the example with Boost 1.68 and while it compiles (after changing with_context to context) it does not link. Undefined reference to bool fun::parser::some_member_func_i_dont_remember<IteratorTemplateSpam>.

Source of the problem: in expression.hpp BOOST_SPIRIT_DECLARE(expression_type) adds some member functions but they are just declarations.

@m-dhooge
Copy link

Funny how things happen!
I just started yesterday to work again on code I developed earlier in 2018 and since then my version of boost upgraded from 65 to 67… And since my code was heavily inspired by x3_fun (BTW, best example ever ;-) ! ), it is also now broken :-/

@djowel
Copy link
Contributor

djowel commented Aug 28, 2018

Let's fix it then, and have it in Boost. I'll see what I can do.

@m-dhooge
Copy link

The error message is:

undefined reference to
bool fun::parser::parse_rule<
  __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
  boost::spirit::x3::context<
    boost::spirit::x3::error_handler_tag,
    std::reference_wrapper<boost::spirit::x3::error_handler<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >,
    boost::spirit::x3::context<
      boost::spirit::x3::skipper_tag,
      boost::spirit::x3::char_class<
        boost::spirit::char_encoding::ascii,
        boost::spirit::x3::space_tag
      > const,
      boost::spirit::x3::unused_type
    >
  >,
  fun::ast::expression
>
(
  boost::spirit::x3::rule<
    fun::parser::expression_class,
    fun::ast::expression,
    false
  >,
  __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&,
  __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&,
  boost::spirit::x3::context<
    boost::spirit::x3::error_handler_tag,
    std::reference_wrapper<boost::spirit::x3::error_handler<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >,
    boost::spirit::x3::context<boost::spirit::x3::skipper_tag, boost::spirit::x3::char_class<boost::spirit::char_encoding::ascii, boost::spirit::x3::space_tag> const, boost::spirit::x3::unused_type>
  > const&,
  fun::ast::expression&
)

@m-dhooge
Copy link

When I objdump -dC expression.o, I can find a single disassembly of parse_rule but with the std::reference_wrapper being const.

@Xeverous
Copy link
Author

Perhaps this from config.hpp is a problem?

typedef x3::context<
    error_handler_tag
  , std::reference_wrapper<error_handler_type> const // <- this?
  , phrase_context_type>
context_type;

@m-dhooge
Copy link

Yep! This indeed solves the link error (and make my old code work again -- which is also great from my own point of view).

But this is in contradiction with boostorg/spirit#254 which still has the const.
However I didn't try to compile it myself.

@m-dhooge
Copy link

OK, so I tried to compile calc8 with a very dirty c++ -o calc *.cpp.
And it seems to have the same kind of parse_rule problem!

PS: calc7 compiles well…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants