[Boost-users] rule.ipp(173) : error C1128: number of sections exceeded object file format limit : compile with /bigobj

23 views
Skip to first unread message

HT4N -

unread,
Nov 5, 2009, 3:35:56 PM11/5/09
to Boost List
I have quite a big grammar now, and basically I have multiple grammars separated into many files and at the root grammar I have many alternations like the following:
 
Root = GrammarA
          | GrammarB
          ...
          | GrammarZ
 
It looks like, the compiler complaining about the size of the inline code.
 
Here is the error message from the compiler:
 
"boost\spirit\core\non_terminal\impl\rule.ipp(173) : error C1128: number of sections exceeded object file format limit : compile with /bigobj"
 
What is the solution to this issue? If I move the grammar definition to .cpp files will it help?
 
Thanks
 
HTan




Windows 7: Unclutter your desktop. Learn more.

Jeff Flinn

unread,
Nov 5, 2009, 4:15:57 PM11/5/09
to boost...@lists.boost.org
HT4N - wrote:
> I have quite a big grammar now, and basically I have multiple grammars
> separated into many files and at the root grammar I have many
> alternations like the following:
>
> Root = GrammarA
> | GrammarB
> ...
> | GrammarZ
>
> It looks like, the compiler complaining about the size of the inline code.
>
> Here is the error message from the compiler:
>
> "boost\spirit\core\non_terminal\impl\rule.ipp(173) : error C1128: number
> of sections exceeded object file format limit : compile with /bigobj"
>
> What is the solution to this issue?

Umm, did you try compiling with /bigobj?

Jeff

_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

HT4N -

unread,
Nov 5, 2009, 4:47:52 PM11/5/09
to Boost List
I did, and it still did not help for "debug" build. For retail build anyway I don't see problem.

What is the common practice if you have let's say more than 30 grammar modules and each grammar has around 5-10 lines of EBNF and you want to separate each grammar into 1 header file.
 
Thanks
 
HT
 
> To: boost...@lists.boost.org
> From: TriumphS...@hotmail.com
> Date: Thu, 5 Nov 2009 16:15:57 -0500
> Subject: Re: [Boost-users] rule.ipp(173) : error C1128: number of sections exceeded object file format limit : compile with /bigobj

Hotmail: Trusted email with Microsoft's powerful SPAM protection. Sign up now.

HT4N -

unread,
Nov 6, 2009, 11:58:57 AM11/6/09
to Boost List

Rename the subject.

What is the suggested practice if you have a fairly big grammar which you split into many header files ?
 
To repeat my problem, I have fairly big grammar and the compiler throws me the following error (for debug build). Retail build is fine. Usig /bigobj does not fix the debug build.

 
> > "boost\spirit\core\non_terminal\impl\rule.ipp(173) : error C1128: number
> > of sections exceeded object file format limit : compile with /bigobj"

 

From: ht...@hotmail.com
To: boost...@lists.boost.org
Date: Thu, 5 Nov 2009 13:47:52 -0800

OvermindDL1

unread,
Nov 6, 2009, 8:39:25 PM11/6/09
to boost...@lists.boost.org
On Thu, Nov 5, 2009 at 2:47 PM, HT4N - <ht...@hotmail.com> wrote:
> I did, and it still did not help for "debug" build. For retail build anyway
> I don't see problem.
>
> What is the common practice if you have let's say more than 30 grammar
> modules and each grammar has around 5-10 lines of EBNF and you want to
> separate each grammar into 1 header file.

The mini-c example project shows how to split up grammars properly,
may take a look at it.

Also, you will get more responses if you post to the Spirit list instead.

Joel de Guzman

unread,
Nov 7, 2009, 6:29:10 PM11/7/09
to boost...@lists.boost.org
HT4N - wrote:
>
> Rename the subject.
>
> What is the suggested practice if you have a fairly big grammar which
> you split into many header files ?
>
> To repeat my problem, I have fairly big grammar and the compiler throws
> me the following error (for debug build). Retail build is fine. Usig
> /bigobj does not fix the debug build.
>
> *> > "boost\spirit\core\non_terminal\impl\rule.ipp(173) : error C1128:
> number
> > > of sections exceeded object file format limit : compile with /bigobj"

I highly suggest moving to spirit2 if you are planning to do any
refactorization. In spirit2 (http://spirit.sourceforge.net/home/)
we have some examples that highlight this:

calc6, calc7 and mini_c are examples of modular grammar constructions.
calc6 is simplest of the three and shows how you can:

1) embed grammars for modularization
2) separate the grammar definition (constructor) from the class declaration
3) instantiate a particular grammar template in a cpp file.

Regards,
--
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net
http://www.facebook.com/djowel

Meet me at BoostCon
http://www.boostcon.com/home
http://www.facebook.com/boostcon

Ray Burkholder

unread,
Nov 7, 2009, 6:54:25 PM11/7/09
to boost...@lists.boost.org
> I highly suggest moving to spirit2 if you are planning to do any
> refactorization. In spirit2 (http://spirit.sourceforge.net/home/)
> we have some examples that highlight this:
>
> calc6, calc7 and mini_c are examples of modular grammar constructions.
> calc6 is simplest of the three and shows how you can:
>
> 1) embed grammars for modularization
> 2) separate the grammar definition (constructor) from the class
> declaration
> 3) instantiate a particular grammar template in a cpp file.
>

Would you be able to provide a direct link to the calc6, calc7 examples?
They don't appear to be directly linked or described on the documentation
page at:
http://spirit.sourceforge.net/home/spirit2/libs/spirit/doc/html/index.html


Thank you.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Chris Hoeppler

unread,
Nov 8, 2009, 9:33:16 AM11/8/09
to boost...@lists.boost.org
On Sunday 08 November 2009, Ray Burkholder wrote:
> > I highly suggest moving to spirit2 if you are planning to do any
> > refactorization. In spirit2 (http://spirit.sourceforge.net/home/)
> > we have some examples that highlight this:
> >
> > calc6, calc7 and mini_c are examples of modular grammar constructions.
> > calc6 is simplest of the three and shows how you can:
> >
> > 1) embed grammars for modularization
> > 2) separate the grammar definition (constructor) from the class
> > declaration
> > 3) instantiate a particular grammar template in a cpp file.
>
> Would you be able to provide a direct link to the calc6, calc7 examples?
> They don't appear to be directly linked or described on the documentation
> page at:
> http://spirit.sourceforge.net/home/spirit2/libs/spirit/doc/html/index.html

http://svn.boost.org/svn/boost/trunk/libs/spirit/example/qi/calc6/

HTH,
Chris

HT4N -

unread,
Nov 9, 2009, 2:51:01 AM11/9/09
to Boost List
To be honest I am a little bit confuse with the examples you mentioned. I do not see where the grammar is now defined in the .cpp file from the example. I only see a declaration of grammar in .hpp.

I would have expect that the Grammar header is defined in .hpp but the actual EBNF definition is defined in .cpp. Hence, I do not see example of (2) in the examples, unless I miss something.
 
About your point (1), I think Classic Spirit also support this. You can have a rule that embed a grammar which is defined in a different file.

Hartmut Kaiser

unread,
Nov 9, 2009, 8:22:29 AM11/9/09
to boost...@lists.boost.org
> To be honest I am a little bit confuse with the examples you mentioned.
> I do not see where the grammar is now defined in the .cpp file from the
> example. I only see a declaration of grammar in .hpp.
>
> I would have expect that the Grammar header is defined in .hpp but the
> actual EBNF definition is defined in .cpp. Hence, I do not see example
> of (2) in the examples, unless I miss something.

But that's exactly what has been done. The grammar/rule definitions are
located in the constructors of the grammars which have been moved out into
separate files.

> About your point (1), I think Classic Spirit also support this. You
> can have a rule that embed a grammar which is defined in a different
> file.

Sure, but it's more difficult to achieve.

Regards Hartmut

-------------------
Meet me at BoostCon
http://boostcon.com

> ________________________________________

Reply all
Reply to author
Forward
0 new messages