gpt4 book ai didi

macos - LibPNG + Boost::GIL: 找不到 png_infopp_NULL

转载 作者:行者123 更新时间:2023-12-01 06:54:44 24 4
gpt4 key购买 nike

尝试使用 Boost::GIL PNG IO 支持编译我的文件时,我总是收到此错误:

(我正在运行 Mac OS X Leopard 和 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

最佳答案

libpng 1.4 删除了 png_infopp_NULL 的定义和 int_p_NULL .所以添加

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

在包含 GIL header 之前的代码中。

关于macos - LibPNG + Boost::GIL: 找不到 png_infopp_NULL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2442335/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com