Save.c

  • tommig
    16th Jan 2012 Member 0 Permalink

    So... straight back into modding, straight back into the errors. :-(

    My error occurs only in the file Save.c, where the term 'iter' is completely littered, and seems to be causing problems...

    There are two repeated errors:

    1) 1>facialturd-the-powder-toy-7f850ad\src\save.c(118): error C2275: 'bson' : illegal use of this type as an expression

    2) 1>facialturd-the-powder-toy-7f850ad\src\save.c(124): error C2065: 'iter' : undeclared identifier

    Is the source MSVC compatible, and can I fix these?

    Thanks

    Tommig

  • disturbed666
    16th Jan 2012 Member 0 Permalink

    mmm maybe if I have a look at the code ( I'm only a beginner at c++ code so giving an answer here might not be that handy  and probably wrong)

  • jacksonmj
    16th Jan 2012 Developer 0 Permalink
    https://github.com/jacksonmj/The-Powder-Toy/commit/2d21c4eee0f287ce8f759f302e5f30db32af458b

    However, I recommend you use the old save format for now, by removing #define SAVE_OPS from defines.h. There are still a couple of issues with the new save format (soap, replacing existing particles, and rotating/translating stamps).
  • tommig
    16th Jan 2012 Member 0 Permalink
    @jacksonmj (View Post)

    Ok! Thanks! I'll take the second option!

    Edit:

    That did little, should I just remove Save + Bson from the project?

  • jacksonmj
    16th Jan 2012 Developer 0 Permalink
    #define SAVE_OPS only sets the default format, the OPS code still gets compiled so the variable declarations will still cause errors in MSVC.

    You need to make the changes in the commit I linked to (or just download the new file from https://raw.github.com/jacksonmj/The-Powder-Toy/2d21c4eee0f287ce8f759f302e5f30db32af458b/src/save.c instead of making the changes manually).
  • tommig
    16th Jan 2012 Member 0 Permalink

    And yet again I'm left with:

    1>interface.obj : error LNK2019: unresolved external symbol _addchar referenced in function _draw_svf_ui

    I looked at the last fix you sent me for this, but I can seem to get it to work for me. It did last time...

    EDIT:

    Scratch that! I was looking at the wrong part of the code!

  • jacksonmj
    16th Jan 2012 Developer 0 Permalink
    Search for the word "_inline", and remove it everywhere you see it. addchar is in src/graphics.c
  • tommig
    16th Jan 2012 Member 0 Permalink

    @jacksonmj (View Post)

    There was only 1 instance where I needed to remove '_inline' Graphics.c 891

    The addchar is replacing 'void' with 'char' in Luaconsole.c 579 and 583

    You'd give me a fix for that in November, but because the code has been added to since, I couldn't find it!