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...)).
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.
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.
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
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).