X3: declare/define/instantiate linker error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

X3: declare/define/instantiate linker error

Tore Halvorsen
Hi,

I tried to make a rather large X3 parser and got into problems with compiler heap space. I figured that I could break the parser into different pieces with declare/define/instantiate, but I get a linking error.

The problem only exists when foo_def = a() >> x3::lit(":") >> b();
If this is changed to foo_def = a() >> b(); the linking issue disappears.

So, is my basic approach sound? In the larger project I have several fusion structs that is build up using more fusion structs.

Is there another way to split parsers into different parts?

I'm using visual studio vs14_1 and boost 1_64, and this is the smallest version where I managed to reproduce the problem.

The abbrivated linking error is:
Error    LNK2019    unresolved external symbol "bool __cdecl field::parse_rule<class std::_String_const_iterator<class std::_String_val<struct std::_Simple_types<char> > >,struct boost::spirit::x3::unused_type,struct boost::fusion::iterator_range<struct boost::fusion::basic_iterator<struct boost::fusion::struct_iterator_tag,struct boost::fusion::random_access_traversal_tag,struct s::foo,0>,struct boost::fusion::basic_iterator<struct boost::fusion::struct_iterator_tag,struct boost::fusion::random_access_traversal_tag,struct s::foo,1> > >  



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

group.cpp (294 bytes) Download Attachment
group.h (496 bytes) Download Attachment
field.cpp (384 bytes) Download Attachment
field.h (594 bytes) Download Attachment
field_def.h (824 bytes) Download Attachment
group_def.h (684 bytes) Download Attachment
struct.h (454 bytes) Download Attachment
main.cpp (242 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: X3: declare/define/instantiate linker error

cppljevans
On 05/18/2017 03:52 AM, Tore Halvorsen wrote:

> Hi,
>
> I tried to make a rather large X3 parser and got into problems with
> compiler heap space. I figured that I could break the parser into
> different pieces with declare/define/instantiate, but I get a linking error.
>
> The problem only exists when foo_def = a() >> x3::lit(":") >> b();
> If this is changed to foo_def = a() >> b(); the linking issue disappears.
>
> So, is my basic approach sound? In the larger project I have several
> fusion structs that is build up using more fusion structs.
>
> Is there another way to split parsers into different parts?
>
I think this is the same or similar problem reported earlier:

http://boost.2283326.n4.nabble.com/Linking-error-when-changing-to-tp4689820p4690028.html

When your code is compiled using the  fork/branch here:

https://github.com/cppljevans/spirit/tree/get_rhs

it links successfully according to the attached.

HTH.

-regards,
Larry


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

compilation.out (8K) Download Attachment