我尝试(重新)安装libpng++-dev
,但收到以下错误消息:
[...]
The following packages have unmet dependencies:
libpng++-dev : Depends: libpng-dev
E: Unable to correct problems, you have held broken packages.
我试着这样处理无法解决未满足的依赖关系
但我无法解决这个问题。有人有想法吗?
编辑:sudo apt-cache search libpng* 的输出:
libpng12-0 - PNG library - runtime
libpng12-dev - PNG library - development
fp-units-gfx - Free Pascal - graphics-library units dependency package
fp-units-gfx-3.0.0 - Free Pascal - graphics-library units
libpnetcdf-dev - Development files for the parallel netCDF library
libpnetcdf0d - Libraryfor reading and writing parallel NetCDF files
libpng++-dev - C++ interface to the PNG (Portable Network Graphics) library
libpng-sixlegs-java - Sixlegs Java PNG Decoder
libpng-sixlegs-java-doc - Documentation for Sixlegs Java PNG Decoder
libpng16-16 - PNG library - runtime (version 1.6)
libpng16-dev - PNG library - development (version 1.6)
libpng16-devtools - PNG library - tools (version 1.6)
libpng16-tools - PNG library - tools (version 1.6)
libpng3 - PNG library - runtime
libpnglite-dev - lightweight C library for loading and writing PNG images
pngquant - PNG (Portable Network Graphics) image optimising utility
ruby-oily-png - native mixin to speed up ChunkyPNG
tkpng - PNG photo image support to Tcl/Tk
编辑2:
抱歉,但是现在我收到另一条错误消息(编译 C++ 程序后):
/usr/include/png++/reader.hpp:110: error: undefined reference to 'png_set_longjmp_fn'
谷歌说我应该从 libpng 链接到正确的版本,但我该怎么做呢?
答案1
跑步:
sudo apt-cache search libpng*
示例输出:
libpng12-0 - PNG library - runtime
libpng12-dev - PNG library - development
fp-units-gfx - Free Pascal - graphics-library units dependency package
fp-units-gfx-3.0.0 - Free Pascal - graphics-library units
libpnetcdf-dev - Development files for the parallel netCDF library
libpnetcdf0d - Libraryfor reading and writing parallel NetCDF files
libpng++-dev - C++ interface to the PNG (Portable Network Graphics) library
libpng-sixlegs-java - Sixlegs Java PNG Decoder
libpng-sixlegs-java-doc - Documentation for Sixlegs Java PNG Decoder
libpng16-16 - PNG library - runtime (version 1.6)
libpng16-dev - PNG library - development (version 1.6)
libpng16-devtools - PNG library - tools (version 1.6)
libpng16-tools - PNG library - tools (version 1.6)
libpng3 - PNG library - runtime
libpnglite-dev - lightweight C library for loading and writing PNG images
pngquant - PNG (Portable Network Graphics) image optimising utility
ruby-oily-png - native mixin to speed up ChunkyPNG
tkpng - PNG photo image support to Tcl/Tk
然后运行:
sudo apt install libpng12-dev
sudo apt install libpng++-dev
编辑
最新版本libpng
可以从这里下载:libpng-1.6.26.tar.xz
,安装如下:
tar xvf libpng-1.6.26.tar.xz
cd libpng-1.6.26
./configure
make check
make install
您可以运行./configure --prefix=/path
,path
=要安装二进制文件的目录的路径