Re: X3: declare/define/instantiate linker error

Larry Evans <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general
compilation.out (text/plain, 6.1 KB)
-*- mode: compilation; default-directory: "~/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/workbench/x3/Halvorsen_link_error/" -*-
Compilation started at Thu May 18 10:48:40

make run
/home/evansl/dwnlds/llvm/3.9/prebuilt/clang+llvm-3.9.0-x86_64-linux-gnu-ubuntu-16.04/bin/clang++ -c -O0 -stdlib=libc++  -std=c++1z -ftemplate-backtrace-limit=0 -fdiagnostics-show-template-tree -fno-elide-type -fmacro-backtrace-limit=0     -I/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include -I/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0 -DBOOST_SPIRIT_GET_RHS_CRTP=1 -DBOOST_SPIRIT_ATTR_XFORM_IN_RULE=1     -ftemplate-depth=200  main.cpp -MMD -o /tmp/build/clangxx3_9_pkg/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/workbench/x3/Halvorsen_link_error/main.o 
In file included from main.cpp:1:
In file included from ./group.h:6:
In file included from /home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3.hpp:17:
In file included from /home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3/nonterminal.hpp:10:
/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3/nonterminal/rule.hpp:17:11: warning: 
      yes(BOOST_SPIRIT_ATTR_XFORM_IN_RULE) [-W#pragma-messages]
  #pragma message "yes(BOOST_SPIRIT_ATTR_XFORM_IN_RULE)"
          ^
/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3/nonterminal/rule.hpp:26:11: warning: 
      yes(BOOST_SPIRIT_GET_RHS_CRTP) [-W#pragma-messages]
  #pragma message "yes(BOOST_SPIRIT_GET_RHS_CRTP)"
          ^
2 warnings generated.
/home/evansl/dwnlds/llvm/3.9/prebuilt/clang+llvm-3.9.0-x86_64-linux-gnu-ubuntu-16.04/bin/clang++ -c -O0 -stdlib=libc++  -std=c++1z -ftemplate-backtrace-limit=0 -fdiagnostics-show-template-tree -fno-elide-type -fmacro-backtrace-limit=0     -I/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include -I/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0 -DBOOST_SPIRIT_GET_RHS_CRTP=1 -DBOOST_SPIRIT_ATTR_XFORM_IN_RULE=1     -ftemplate-depth=200  field.cpp -MMD -o /tmp/build/clangxx3_9_pkg/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/workbench/x3/Halvorsen_link_error/field.o 
In file included from field.cpp:1:
In file included from ./field_def.h:6:
In file included from /home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3.hpp:17:
In file included from /home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3/nonterminal.hpp:10:
/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3/nonterminal/rule.hpp:17:11: warning: 
      yes(BOOST_SPIRIT_ATTR_XFORM_IN_RULE) [-W#pragma-messages]
  #pragma message "yes(BOOST_SPIRIT_ATTR_XFORM_IN_RULE)"
          ^
/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3/nonterminal/rule.hpp:26:11: warning: 
      yes(BOOST_SPIRIT_GET_RHS_CRTP) [-W#pragma-messages]
  #pragma message "yes(BOOST_SPIRIT_GET_RHS_CRTP)"
          ^
2 warnings generated.
/home/evansl/dwnlds/llvm/3.9/prebuilt/clang+llvm-3.9.0-x86_64-linux-gnu-ubuntu-16.04/bin/clang++ -c -O0 -stdlib=libc++  -std=c++1z -ftemplate-backtrace-limit=0 -fdiagnostics-show-template-tree -fno-elide-type -fmacro-backtrace-limit=0     -I/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include -I/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0 -DBOOST_SPIRIT_GET_RHS_CRTP=1 -DBOOST_SPIRIT_ATTR_XFORM_IN_RULE=1     -ftemplate-depth=200  group.cpp -MMD -o /tmp/build/clangxx3_9_pkg/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/workbench/x3/Halvorsen_link_error/group.o 
In file included from group.cpp:1:
In file included from ./group_def.h:6:
In file included from /home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3.hpp:17:
In file included from /home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3/nonterminal.hpp:10:
/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3/nonterminal/rule.hpp:17:11: warning: 
      yes(BOOST_SPIRIT_ATTR_XFORM_IN_RULE) [-W#pragma-messages]
  #pragma message "yes(BOOST_SPIRIT_ATTR_XFORM_IN_RULE)"
          ^
/home/evansl/prog_dev/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/include/boost/spirit/home/x3/nonterminal/rule.hpp:26:11: warning: 
      yes(BOOST_SPIRIT_GET_RHS_CRTP) [-W#pragma-messages]
  #pragma message "yes(BOOST_SPIRIT_GET_RHS_CRTP)"
          ^
2 warnings generated.
/home/evansl/dwnlds/llvm/3.9/prebuilt/clang+llvm-3.9.0-x86_64-linux-gnu-ubuntu-16.04/bin/clang++ -stdlib=libc++    /tmp/build/clangxx3_9_pkg/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/workbench/x3/Halvorsen_link_error/main.o /tmp/build/clangxx3_9_pkg/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/workbench/x3/Halvorsen_link_error/field.o /tmp/build/clangxx3_9_pkg/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/workbench/x3/Halvorsen_link_error/group.o  -o /tmp/build/clangxx3_9_pkg/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/workbench/x3/Halvorsen_link_error/main.exe
/tmp/build/clangxx3_9_pkg/boost/releases/ro/boost_1_63_0/sandbox/pull_requests/context_debug_fix.fork/spirit/workbench/x3/Halvorsen_link_error/main.exe 

Compilation finished at Thu May 18 10:48:44
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.