Boost GIL write_view throws LNK2019 errors

201 views Asked by At

I want to learn how to load, write, ... *.png images with Boost GIL.
(My programming environment is VS 2019)

The problem is that GIL has problems with saving/loading files.
It throws many LNK2019 errors.

My Code is:

boost::gil::rgb8_image_t img(512, 512);
boost::gil::rgb8_pixel_t red(255, 0, 0);
boost::gil::fill_pixels(boost::gil::view(img), red);
boost::gil::write_view("test2.png", boost::gil::const_view(img), boost::gil::png_tag());
             // ^ not only write_view but also read_image

This is one of the errors (all errors here):

unresolved external symbol _png_create_write_struct referenced in function "public: __thiscall boost::gil::writer_backend<class
boost::gil::detail::file_stream_device<struct boost::gil::png_tag>,struct boost::gil::png_tag>::writer_backend<class boost::gil::detail::file_stream_device<struct
boost::gil::png_tag>,struct boost::gil::png_tag>(class boost::gil::detail::file_stream_device<struct boost::gil::png_tag> const &,struct
boost::gil::image_write_info<struct boost::gil::png_tag,class boost::gil::no_log> const &)"
(??0?$writer_backend@V?$file_stream_device@Upng_tag@gil@boost@@@detail@gil@boost@@Upng_tag@34@@gil@boost@@QAE@ABV?$file_stream_
device@Upng_tag@gil@boost@@@detail@12@ABU?$image_write_info@Upng_tag@gil@boost@@Vno_log@23@@12@@Z)
0

There are 0 answers