libpng "png_set_longjmp_fn";未找到

2021-12-31 00:00:00 compiler-errors c++ libpng

我正在使用来自 ubuntu 的 libpng,当我尝试编译一个 C++ 文件时,我得到了

I'm using libpng from ubuntu and when I try to compile a c++ file I get

未定义对`png_set_longjmp_fn'的引用

undefined reference to `png_set_longjmp_fn'

我使用的是 libpng 1.6.8 版

I'm using libpng version 1.6.8

如果您有兴趣阅读代码,请告诉我,但我认为这与我的代码不好有关.

If you are interested in reading the code please let me know, but I do not this has to do with my bad code.

提前致谢.

推荐答案

也许您已经使用 libpng-1.6.8 构建,但链接到早期版本的 libpng.png_set_longjmp_fn()"API 是在 libpng-1.4.x 中引入的.Ubuntu 13:10 当前带有 libpng-1.2.49(参见/usr/include/libpng12),它不提供 png_set_longjmp_fn().

Perhaps you have built with libpng-1.6.8 but are linking to an earlier version of libpng. The "png_set_longjmp_fn()" API was introduced in libpng-1.4.x. Ubuntu 13:10 currently comes with libpng-1.2.49 (see /usr/include/libpng12), which does not supply png_set_longjmp_fn().

相关文章