Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LibPNG + Boost::GIL: png_infopp_NULL not found

I always get this error when trying to compile my file with Boost::GIL PNG IO support:

(I'm running Mac OS X Leopard and Boost 1.42, LibPNG 1.4)

/usr/local/include/boost/gil/extension/io/png_io_private.hpp: In member function 'void boost::gil::detail::png_reader::init()':
/usr/local/include/boost/gil/extension/io/png_io_private.hpp:155: error: 'png_infopp_NULL' was not declared in this scope
/usr/local/include/boost/gil/extension/io/png_io_private.hpp:160: error: 'png_infopp_NULL' was not declared in this scope
/usr/local/include/boost/gil/extension/io/png_io_private.hpp: In destructor 'boost::gil::detail::png_reader::~png_reader()':
/usr/local/include/boost/gil/extension/io/png_io_private.hpp:174: error: 'png_infopp_NULL' was not declared in this scope
/usr/local/include/boost/gil/extension/io/png_io_private.hpp: In member function 'void boost::gil::detail::png_reader::apply(const View&)':
/usr/local/include/boost/gil/extension/io/png_io_private.hpp:186: error: 'int_p_NULL' was not declared in this scope
/usr/local/include/boost/gil/extension/io/png_io_private.hpp: In member function 'void boost::gil::detail::png_reader_color_convert<CC>::apply(const View&)':
/usr/local/include/boost/gil/extension/io/png_io_private.hpp:228: error: 'int_p_NULL' was not declared in this scope
/usr/local/include/boost/gil/extension/io/png_io_private.hpp: In member function 'void boost::gil::detail::png_writer::init()':
/usr/local/include/boost/gil/extension/io/png_io_private.hpp:317: error: 'png_infopp_NULL' was not declared in this scope
like image 260
Viet Avatar asked Nov 28 '22 10:11

Viet


1 Answers

libpng 1.4 dropped definitions of png_infopp_NULL and int_p_NULL. So add

#define png_infopp_NULL (png_infopp)NULL
#define int_p_NULL (int*)NULL

in your code before including GIL headers.

like image 152
wdscxsj Avatar answered Dec 02 '22 21:12

wdscxsj