First post, by thecrankyhermit
I'm just trying to play around with the source code, nothing serious. This is mainly a case of satisfying my OCD intolerance for imperfections. Everything runs fine if I set:
#define C_SSHOT 0
or if I just don't try to take snapshots.
I am building from stable 0.74 code, using Visual Studio 2008. I am linking with all of the libraries except for curses. I got libpng.lib and zlib.lib from the GnuWin32 as stated in the INSTALL file.
The Zlib paragraph says:
For win32 get libz (rename to zlib) from http://gnuwin32.sourceforge.net/packages.html
However, there is no "libz" there, just a "zlib," which I got.
I got it to compile, but if I try to run it, it needs "libpng12.dll" and "zlib1.dll." I don't understand why, because the official version doesn't need them, and it works with screenshots just fine. But I get these files too, from the same place, and put them with the DOSBox executable.
Next, I build it in debug mode. I run it, and it works fine. If I press CTRL+F5 to take a snapshot, a 0-byte png file is created.
Release mode also builds and runs fine. But if I press CTRL+F5 to take a snapshot, it simply crashes with an unhandled exception.
How can I find out what is going wrong?
I found that in hardware.cpp, this line:
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL,NULL, NULL);
seems to be where things start to go wrong. If I set a breakpoint there, this is the last line of code I can step through before the Release build crashes. And in debug mode, it returns a null pointer.
Running:
Windows 10
Core i5-6600
Geforce GTX 970
8GB RAM