I am on win7 64bit home edition. All of my projects are set to build in a 32bit environment using C++. I have successfully built libpng in debug mode using MDd runtime. I have two active projects. My first project is in VS2010 and my second is in VS2012. Within my computer I created an environment variable set to the path for this library to make linking easier in my projects. Both my projects are using MDd as well as multibyte which is the same that libpng uses. All of my paths and dependencies are correct. I also copied over the libpng16.dll into both projects within the same directory as their built executable. I can successfully compile and build both projects. My VS2010 project runs and renders the loaded PNG graphic, however my project in VS2012 doesn't. It crashes when I call png_read_png throwing and unhandled exception that breaks on this line:
check = fread( data, 1, length, png_voidcast( png_FILE_p, png_ptr->io_ptr ) );
within pngrio.c. giving this error:
First-chance exception at 0x77308E19 (ntdll.dll) in Game_debug.exe: 0xC0000005:
Access violation writing location 0x00000014.
The problem is not within my source code since I know that it works in my VS2010 project and I am using the same implementation to load the png in my VS2012 project. I am not sure off hand if it makes a difference that the library I am linking to was built in VS2010 or if there are some command line / compiler settings within the VS2010 built library that my VS2012 project doesn't like. I've read through the png documentation and searched online for hours and couldn't seem to find anything relevant. Any kind of help, tips, pointers or suggestions would do me a great deal.