CImg gives error Access violation writing location for reading PNG file

363 views Asked by At

I try to run this very simple code and I get a strange error at the CImg library at line png_read_info(png_ptr,info_ptr); the error is: Unhandled exception at 0x779f8dc9 in test.exe: 0xC0000005: Access violation writing location 0x00000014. the code is:

define cimg_use_png
include "CImg.h"
include "png.h"



using namespace std;
using namespace cimg_library;

int main() 
{
CImg<unsigned char> image("Road.png");
image.display();
return 0;
}

I have to mention that I included libpng library to my project property sheet as it is explained in here. http://www.piko3d.com/tutorials/libpng-tutorial-loading-png-files-from-streams

0

There are 0 answers