Re: Linking error when changing > to >>

Seth <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 14-11-16 19:16, Larry Evans wrote:
> which #include's the .cpp files instead of just "example.hpp"?

yes. It's quite impossible to get a linker error that way. See
https://github.com/sehe/linker_error_example (commit ZIP
<https://codeload.github.com/sehe/linker_error_example/zip/eb4356d8cdf1be32a606fb65e8deb1e286fb03ca>),
alternatively with the (originally) breaking change applied
<https://github.com/sehe/linker_error_example/archive/948f476e6be54fadf9ad60c57a4bd6c0193970be.zip>).

> Could you please give me a hit about what I'm doing wrong?
Not looking at the error message, but going from the code changes:

 1. you forgot to remove the cpps that you now include from the build/link
 2. you include types.hpp AFTER use in example.cpp. That might work
    because of POI but it's not a logical thing to do as example_def
    USES types.h
 3. you didn't spot the name clash in example.cpp, possibly for that
    same reason

> Could you provide an example? Is:
>
>  
> https://github.com/cppljevans/boost_1_61_problem/blob/master/expression.cpp#L9
>
> such an example?
No that's not it, because the instantiation is very different from that.
Try
<https://github.com/sehe/linker_error_example/commit/021b36105e010b9134b76cdf8b47952589d5fff8#diff-947c7a9582917a8ff2de55181f3049caR38>:

namespace {
    template <typename Seq, size_t N>
        using field_at =
boost::fusion::basic_iterator<boost::fusion::struct_iterator_tag,
boost::fusion::random_access_traversal_tag, Seq, N>;
    template <typename Seq, size_t N, size_t M>
        using fields   = boost::fusion::iterator_range<field_at<Seq, N>,
field_at<Seq, M> >;

    using Attributes = fields<client::ast::VariableDec, 1, 2>;
    using Context  = x3::context<x3::skipper_tag,
x3::char_class<boost::spirit::char_encoding::ascii, x3::space_tag>
const, x3::unused_type>;
}

template bool parse_rule<std::string::const_iterator, Context,
fields<client::ast::VariableDec, 1, 2> >(
    decltype(type),
    std::string::const_iterator &,
    std::string::const_iterator const &,
    Context const &,
    Attributes &);

See on my
https://github.com/sehe/linker_error_example/tree/explicit_instantiation
branch (ZIP
<https://github.com/sehe/linker_error_example/archive/explicit_instantiation.zip>)

------------------------------------------------------------------------------

_______________________________________________
Spirit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general
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.