TPT compiles, but crashes

  • abczyx123987
    28th Jul 2011 Member 0 Permalink
    An unmodified source of TPT compiles for me, but if I open it up and click on the "Find and open a simulation" button, the front page of the saves appears briefly before TPT crashes.
    Also, if I try to copy or save something (with Ctrl+C or Ctrl+S), it crashes (after I drag what I want to have copied/saved).
    Stamps load, but as soon as I try to place them anywhere, TPT crashes. It also crashes when I try to load a save I have saved to my hard disk.

    All of the elements and walls and such work correctly, though, as well as signing in to the server.
    Also, everything works correctly if I download the already compiled one from the website (https://powdertoy.co.uk/Download/powder-52.0-win32.zip).

    I'm running Windows XP SP3 and compiling with MinGW (from a console window, not from any sort of IDE).
    All of the libraries should be there (otherwise it wouldn't have compiled and linked successfully, right?).
    Well, all but the one specified by "-lX11" in the makefile (I had to delete it to get it to work, and besides, I couldn't find this "X11" thing for Windows (only for Linux and such...)).

    What's going on here?
  • Pilihp64
    28th Jul 2011 Developer 0 Permalink
    I've had the exact same issue compiling from MinGW, and i never found a solution, others have had the same issues. (this was many months ago, and not many people are using MinGW)
    I don't think the exact problem has ever been found yet, for now try using a different compiler.
  • jacksonmj
    28th Jul 2011 Developer 0 Permalink
    I've just tried with MinGW on Windows XP SP3, and it works perfectly for me.

    Where did you get all the libraries from, what versions are they, and what command are you using to compile?
    Also, have you tried debugging it?

    (and yes, -lX11 is only for Linux)
  • abczyx123987
    28th Jul 2011 Member 0 Permalink

    cracker64:

    for now try using a different compiler.

    I once tried using Visual Studio, but it said it couldn't open some of the .lib files (I'm pretty sure I had it all linked correctly, but...). Besides, an earlier version of TPT (before python/lua console, I think?) that I once manage to compile successfully crashed as soon as I tried to put a particle in.

    @jacksonmj (View Post)
    The libraries come from the ones the Wiki said to download...(#3 in https://powdertoy.co.uk/Wiki.html?id=codeblocks_setup#mingw_preparation)
    The Lua libraries should be the latest (5.1, I think?).

    The command I used to compile was
    mingw32-make powder-sse3.exe

    And as for debugging...
    ...(doing that right now)...

    Okay, that was strange...
    For some reason, if I add -ggdb to the makefile, and compile, it runs perfectly fine...no crashes or anything.

    Now why would this be?
  • jacksonmj
    28th Jul 2011 Developer 0 Permalink
    I'm wondering whether this is something to do with using an incompatible bzip2 DLL. The actions you mention as causing crashes all involve calls to bzip2.

    The wiki links to bzip2-1.0.5-lib.zip, but that doesn't include a DLL. So it might be finding one elsewhere on your system that doesn't work properly with the MinGW bzip2.lib file

    Can you try using http://gnuwin32.sourceforge.net/downlinks/bzip2-bin-zip.php ?
  • abczyx123987
    28th Jul 2011 Member 0 Permalink
    http://gnuwin32.sourceforge.net/downlinks/bzip2-bin-zip.php works.
    Linking to just libbz2.a (that's the static library, I think?) works as well.

    I'm not sure where I got that incompatible DLL from...must've been from one of my previous attempts to compile with Visual Studio (the one from Source-Required.zip ? Not sure what I was thinking there).

    Anyway, it works perfectly now.

    Thanks a lot!