v1.0.08 too many sections error

About Monkey 2 Forums Monkey 2 Programming Help v1.0.08 too many sections error

This topic contains 7 replies, has 2 voices, and was last updated by  Angus 1 year, 5 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #11433

    Angus
    Participant

    Compiling my code in the latest version produces this output:

    It’s tricky to reproduce, as code which works standing alone crashes it when it’s part of my main program.

    This class can be compiled in a tiny program fine:

     

    But in place in my code it produces the above error, but not if I rem out all the field lines.  It’s not a class I’m really using yet, so remming out the lines allows the code to run fine.  The code compiled ok on the previous release, though as here the class was only declared and never used…

    In a way I hope that as the code I’m working on develops this class might not have to be how it is anyway, but I digress.

    #11434

    Angus
    Participant

    Also, I assume the first pair of things in the error report aren’t serious.  One comes from mojo, and the other comes from my own code which is mimicking mojo.

    #11436

    Mark Sibly
    Keymaster

    This can happen in mingw when using reflection in debug mode – the compiler is generating too many symbols and is hitting some kind of built-in hard limit. I can do the same thing to ted2go by adding #import “<reflection>”.

    The reflection system needs some mechanism to prevent it generating reflection info for *everything*, which is something I hope to work on soon. This should both speed up compile times for apps that use reflection and hopefully fix this problem in general.

    In the meantime, you can try using MX2_CPP_OPTS_WINDOWS_DEBUG=-O2 in bin/env_windows.txt, or building in release mode. This fixes the problem for ted2go anyway.

    #11437

    Angus
    Participant

    Yup, making the change in env_windows has made it work again.  First build after changing 5.45!  But less than a minute after that, so much more bearable.  Have noticed much longer compile times since importing reflection in general though, yeh.

    Glad to be able to use the latest release.

    Thanks!

    #11438

    Mark Sibly
    Keymaster

    Just did a few experiments, and -Os seems to be fastest and produces smallest output file sizes. I think I’ll change debug opts to this.

    The main overhead once everything’s built the first 2 times is linking. Switching to MSVC can greatly reduce link times, but can be a bit fiddly to get going.

    #11439

    Angus
    Participant

    Well, with that setting I’m back down to 36 seconds.  If switching to MSVC is something I can do I may look into it, but I feel like I have leg room at that compile time.  Don’t want to add another fiddly thing to the heap just yet  🙂  If it becomes necessary…

    Thanks again.

    #11441

    Angus
    Participant

    Actually, looking at other topics on the subject, it probably wouldn’t be too tricky.  My source isn’t that huge, I could probably wait less than 36 seconds and yeh, the linking is taking almost all of that.  I’ll figure it out, I’m sure…

    #11462

    Angus
    Participant

    I’ve had a go at switching to MSVC and the speed increase seems massive, but I haven’t quite got it working.

    Rebuilding the modules seemed to take a fraction of the time, but I feel like there may be many variables affecting those times?

    By default the only readily available version installed an SDK number that monkey didn’t want I think? (sorry for ignorance)  But it was quite easy to get MSVS2017 to install the right one (10.0.15063.0), and now much of my code seems to compile… except when I include the reflection module!  Now it so happens I might be changing tack when it comes to using reflection for my present purpose anyway, but it’s still something I’d like to use in the future.

    I’m not sure if I’ve installed MSVC incorrectly or what, but this is the output I get when I compile my code with the relflection module:

     

    I’ll probably pursue my new plan using MSVC and see if the reflection issue can be addressed later.  All the rest of my code is compiling fine, and in a fraction of what it was regardless of reflection module.  Less than 30 seconds for a big compile and less than 5 most of the time, a huge boost!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.