No. of sections exceeded object file format limit

Monkey Forums/Monkey Bug Reports/No. of sections exceeded object file format limit

therevills(Posted 2012) [#1]
GLFW Issue:

D:\CodeMonkey\diddy\examples\DiddyData\diddydata.build\glfw\main.cpp : fatal error C1128: number of sections exceeded object file format limit : compile with /bigobj

To test, please checkout the latest version of Diddy and try to compile the diddydata example in GLFW (windows).


marksibly(Posted 2012) [#2]
Hi,

Can you please provide/email me a zip?


therevills(Posted 2012) [#3]
Just uploaded the latest version:
http://diddy.googlecode.com/files/diddy_r512.zip


Ferdi(Posted 2012) [#4]
I remember having this problem ... this is how I fixed it:

1. Open ..targets\glfw\vc2010\MonkeyGame.sln in VC++ Express 2010,
2. Once opened, right click on "MonkeyGame" project in the Solution Explorer.
3. Choose "Properties"
4. Then go to "Configuration Properties" -> "C/C++" -> "Command Line"
5. In "Additional Options", add "/bigobj"

Seems to work for me, and I haven't seen any side effects yet.


therevills(Posted 2012) [#5]
Yeah, that the solution I found too, thanks Ferdi.

I just wonder why Monkey is generating an object so big, I guess it because in my example I am using the reflection module with no filters.

http://msdn.microsoft.com/en-us/library/ms173499(v=vs.80).aspx


marksibly(Posted 2012) [#6]
Hi,

/bigobj will be added to the next release.

The problem is that VC wants to put each function in its own 'section' for some reason, and with reflection turned on there are a lot of little 'stub' functions added.

Better control over what gets reflected is coming, which will help reduce the amount of stub code.


Shinkiro1(Posted 2012) [#7]
Additions to refclection would be great.

I once 'unintentionally' imported reflection and after 5 mins of compiling and my computer running hot I knew there was something wrong. I took a look at the build dir of glfw and the main.cpp file had suddenly 5.1MB with 150 000 lines of code in it -.- (normally only ~20 000).

Btw, could one speed compilation times if we seperated the main.cpp file in smaller files (e.g. mojo.cpp, etc.)