gpt4 book ai didi

c - libpng 1.5.10 错误 : dereferencing pointer to incomplete type

转载 作者:太空狗 更新时间:2023-10-29 17:15:38 25 4
gpt4 key购买 nike

png_read_info (png_ptr, info_ptr);
{
png_byte color_type = info_ptr->color_type;
png_byte bit_depth = info_ptr->bit_depth;
...

最后两行我得到

error: dereferencing pointer to incomplete type

怎么了?在 libpng 1.4 中,这总是可以的。

最佳答案

png_info 结构已从 1.5.0 中的 png.h 中删除,现在您应该将此指针与 png_get_* 一起使用,并且png_set_* 函数。

libpng manual 中所述:

The png_info structure is designed to provide information about the PNG file. At one time, the fields of png_info were intended to be directly accessible to the user. However, this tended to cause problems with applications using dynamically loaded libraries, and as a result a set of interface functions for png_info (the png_get_*() and png_set_*() functions) was developed, and direct access to the png_info fields was deprecated..

例如:

png_uint_32 height;
height = png_get_image_height( png_ptr, info_ptr);

关于c - libpng 1.5.10 错误 : dereferencing pointer to incomplete type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10507610/

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