编译光流图color_flow打开程序的时候,出现错误:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
$ make g++ -O3 -W -Wall -c -o Convert.o Convert.cpp g++ -O3 -W -Wall -c -o Convolve.o Convolve.cpp g++ -O3 -W -Wall -c -o Image.o Image.cpp g++ -O3 -W -Wall -c -o ImageIO.o ImageIO.cpp ImageIO.cpp: In function ‘void ReadFileTGA(CByteImage&, const char*)’: ImageIO.cpp:169:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (h.cMapBits != 24) ^~ ImageIO.cpp:171:6: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ int l = fileBytes * cMapSize; ^~~ ImageIO.cpp: In function ‘void ReadFilePGM(CByteImage&, const char*)’: ImageIO.cpp:358:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (stream == 0) ^~ ImageIO.cpp:361:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ int width, height, nBands; ^~~ ImageIO.cpp: In function ‘void read_header(FILE*, const char*, char, char, int*, int*, int*, int)’: ImageIO.cpp:334:25: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] fscanf(fp, "%d", width); ^ ImageIO.cpp:336:26: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] fscanf(fp, "%d", height); ^ ImageIO.cpp:339:27: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] fscanf(fp, "%d", nbands); ^ g++ -O3 -W -Wall -c -o ImageIOpng.o ImageIOpng.cpp ImageIOpng.cpp:19:17: fatal error: png.h: No such file or directory #include "png.h" ^ compilation terminated. <builtin>: recipe for target 'ImageIOpng.o' failed make: *** [ImageIOpng.o] Error 1 |
问题出现在环境上,主要是依赖包没有安装,使用以下命令安装即可:
Centos:
sudo yum install libpng-devel
Ubuntu:
sudo apt install libpng-dev







最新评论
站长您好,亚马逊云咨询推广资源,望建立联系,可邮件,谢谢。
换友情链接吗?
看你的站做的挺不错的
恭喜!!太强了,硕博连读啊
雁过留毛,人过留名。
看不懂但大受震撼
每天都在战争,希望2026和平.
ZeroTier 看过多篇帖子,目前群辉、飞牛os、win11 、安卓、ubuntu ≥18.04 顺利通过,这篇相对于简单 实用、特来感谢 🙄