ubuntu16.04 安装opencv4.0.1

具体安装步骤参考:https://blog.csdn.net/lgpfc/article/details/87195832

make 过程出现错误:

(1)/usr/bin/ld: /usr/local/lib/libavformat.a(allformats.o): relocation R_X86_64_PC32 against 符号 `ff_a64_muxer' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: 最后的链结失败: 错误的值
collect2: error: ld returned 1 exit status
modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:236: recipe for target 'lib/libopencv_videoio.so.4.0.1' failed
make[2]: *** [lib/libopencv_videoio.so.4.0.1] Error 1
CMakeFiles/Makefile2:3042: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2

出错原因:ffmpeg库错误

解决办法:重新编译ffmpeg

     进入 ffmpeg/:

  • make clean
  • ./configure --enable-nonfree --enable-pic --enable-shared
  • make
  • sudo make install

(2)fatal error : feature2d/test/test_detectors_regression.impl.hpp:没有那个文件或目录

解决办法:将

#include "feature2d/test/test_detectors_regression.impl.hpp"

改为

#include "test_detectors_regression.impl.hpp"

 

你可能感兴趣的:(opencv)