致命错误:png。h:没有这样的文件或目录(MiddleBury评估)

时间:2022-06-05 22:50:48

I am testing stereo algorithm in MiddleBury Stereo Evaluation

我在米德尔伯里立体评价中测试立体算法。

One of step was to compile the tools in code/as follows.

步骤之一是编写代码/如下所示的工具。

cd code/imageLib
make
cd ..
make
cd ..

In this case, there is error in first make as follows,

在这种情况下,首先出现的错误如下,

$ make
g++  -O3 -W -Wall -g  -c -o ImageIOpng.o ImageIOpng.cpp
ImageIOpng.cpp:19:17: fatal error: png.h: No such file or directory
compilation terminated.
make: *** [<builtin>: ImageIOpng.o] Error 1

and, regarding second make,

关于第二次做,

$ make
g++  -g -O3 -W -Wall -IimageLib   ii.cpp  -LimageLib -lImg.i686-g -lpng -lz -o ii
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lImg.i686-g
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lpng
collect2: error: ld returned 1 exit status
make: *** [<builtin>: ii] Error 1

In previous step, make worked fine. So, what was the problem? I downloaded sample algorithm and did not edit/change contents in any file.

在前面的步骤中,使工作正常。那么,问题是什么呢?我下载了示例算法,并没有在任何文件中编辑/修改内容。

1 个解决方案

#1


1  

png.h is part of libpng16-devel and the specific include directory must be added to the include path of your project.

png。h是libpng16-devel的一部分,特定的包含目录必须添加到项目的include路径中。

$ cygcheck -l libpng16-devel |grep png.h
/usr/include/libpng16/png.h

#1


1  

png.h is part of libpng16-devel and the specific include directory must be added to the include path of your project.

png。h是libpng16-devel的一部分,特定的包含目录必须添加到项目的include路径中。

$ cygcheck -l libpng16-devel |grep png.h
/usr/include/libpng16/png.h