This one is really a hard nut to crack. I already made the png initialization look like in the official tutorial and still get that error. I will continue to work on it, though. Just built me some debug libpng & zlib.
Â
EDIT:
I'm now using libpng 1.2.28, debug build.
Â
This bug gets stranger and stranger.
Libpng crashes when trying to write the 8-bit signature ("...PNG...") at the beginning of the file:
Â
pngwio.c:
Line 54: check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
Â
[values:
data = 0x0012ec88 "‰PNGÌÌÌÌH\ΈÃ"
lenght = 8
png_ptr->io_ptr = 0x00adeb70
]
Â
Â
fwrite() crashes here:
fwrite.c (MS C-Runtime):
Line 79: _lock_str(stream); /* lock stream */
Â
Finally, lock_file crashes at "EnterCriticalSection( &(((FILEX *)pf)->lock) );"
Â
Â
Someone help me [img]<fileStore.core_Emoticons>/emoticons/huh.png[/img]/emoticons/huh@2x.png 2x" width="20" height="20" />
Â
Â
EDIT2:
I just found someone having the exact same problem: http://www.mail-archive.com/gnuwin32-users@lists.sourceforge.net/msg00657.html
Â
His solution:
"The solution is relatively simple: just be sure that the project in which you
are using LibPng is compiled with the same "Runtime Library" settings. I think
that by default the lib is compiled in "/MD" (multi-threaded DLL) and a lot
of projects are single threaded by default. This setting can be found in the
project's property under C++/Code Generation (in VC7.1)."
Â
Now, this would be an easy fix, but I already have the same runtime (Multi-Threaded Release/Debug) for zlib/libpng & VBA-M.
Â
Maybe only a static link to libpng as it was default for the MSVC2005 builds will help???
Â
Â
EDIT3:
Of course this bug occurs on all builds from the http://vba-m.com/vbam/vbacompiles/msvc2008/ dir (SVN451 and up). http://vba-m.com/vbam/vbacompiles/VisualBoyAdvance368.rar was the last version working, since it was compiled with MSVC2005 which still has the static link to libpng & zlib. Welcome to DLL hell.