I am trying to write a simple program that would read in a grayscale PNG image using Boost's GIL Image I/O library and then obtain each pixel's information. I have downloaded and extracted the libpng and zlib, included them in my makefile, and linked them.
When trying to execute the following code:
#include <boost/gil/gil_all.hpp>
#include <boost/gil/extension/io/png_dynamic_io.hpp>
#include <iostream>
int main()
{
using std::cout;
using std::endl;
boost::gil::gray16_image_t image;
cout << "TEST";
boost::gil::png_read_and_convert_image("png16_example.png", image);
cout << "test";
return 0;
}
Neither of the "test" print statements work. In fact, nothing happens at all. I commented out the line:
boost::gil::png_read_and_convert_image("png16_example.png", image);
And it runs fine again. I'm not sure what I am doing wrong, as it seems like I've included and linked everything correctly.
Also, if anyone knows of an easier/better way to load in a PNG, I'm also open for suggestions.