openMVG安装 /anaconda3/lib/libpng16.so.16: undefined reference to `inflateValidate@ZLIB_1.2.9‘

问题描述

在安装openMVG make的时候出现报错如下:

[ 82%] Linking CXX executable ../../Linux-x86_64-RELEASE/openMVG_sample_describe_and_match_GUI
/home/XXX/anaconda3/lib/libpng16.so.16:对‘inflateValidate@ZLIB_1.2.9’未定义的引用
collect2: error: ld returned 1 exit status
openMVG_Samples/describe_and_match_GUI/CMakeFiles/openMVG_sample_describe_and_match_GUI.dir/build.make:161: recipe for target 'Linux-x86_64-RELEASE/openMVG_sample_describe_and_match_GUI' failed
make[2]: *** [Linux-x86_64-RELEASE/openMVG_sample_describe_and_match_GUI] Error 1
CMakeFiles/Makefile2:6208: recipe for target 'openMVG_Samples/describe_and_match_GUI/CMakeFiles/openMVG_sample_describe_and_match_GUI.dir/all' failed
make[1]: *** [openMVG_Samples/describe_and_match_GUI/CMakeFiles/openMVG_sample_describe_and_match_GUI.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2

解决方案

网上有很多相关解决方案,比如修改~/.bashrc中的anaconda3相关环境变量,然而并没有用,最后是这么解决的:

首先参考博客:openMVG安装&&问题解决
将/anaconda3/lib/路径下的libpng16.so.16手动删除,然后make发现出现了更多的报错。

接着参考博客:Linux(CentOS, ubuntu)报错:libpng16.so.16: 无法打开共享对象文件: 没有那个文件或目录
使用apt-get命令安装libpng:

sudo apt-get install libpng16-16

没有报错,成功编译!

[ 82%] Linking CXX executable ../../Linux-x86_64-RELEASE/openMVG_sample_describe_and_match_GUI
[ 83%] Built target openMVG_sample_describe_and_match_GUI
[ 83%] Building CXX object openMVG_Samples/geodesy_show_exif_gps_position/CMakeFiles/openMVG_sample_geodesy_show_exif_gps_position.dir/show_exif_gps_position_demo.cpp.o
[ 83%] Linking CXX executable ../../Linux-x86_64-RELEASE/openMVG_sample_geodesy_show_exif_gps_position
[ 83%] Built target openMVG_sample_geodesy_show_exif_gps_position

你可能感兴趣的:(ubuntu,linux,openMVG,anaconda,三维重建)