当前位置:   article > 正文

ubuntu20.04安装opencv 3.2.0 报错_looking for ccache - not found

looking for ccache - not found

安装记录

Error 1:

cmake时报错
CMake Error at cmake/OpenCVCompilerOptions.cmake:21 (else):
A duplicate ELSE command was found inside an IF block.

Fix:

修改opencv-3.2.0/cmake/OpenCVCompilerOptions.cmake文件
注释掉21和22行

      else()
        message(STATUS "Unable to compile program with enabled ccache, reverting...")
        set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${__OLD_RULE_LAUNCH_COMPILE}")
      endif()
    # else()
    #   message(STATUS "Looking for ccache - not found")
    endif()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

Error 2:

fatal error: LAPACKE_H_PATH-NOTFOUND/lapacke.h: No such file or directory #include “LAPACKE_H_PATH-NOTFOUND/lapacke.h”

Fix:

来源:https://blog.csdn.net/Dead_Rabbit6_0/article/details/78044754
需要注意的是在后续的修改中如果修改了源代码,需要重新cmake,就要在make install之前做这个操作

安装sudo apt-get install liblapacke-dev checkinstall
并修改opencv-3.2.0/build/opencv_lapack.h文件

注释掉:
#include"LAPACKE_H_PATH-NOTFOUND/lapacke.h" 
添加:
#include"lapacke.h"
  • 1
  • 2
  • 3
  • 4

Error 3:

error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope

Fix:

来源:https://www.cnblogs.com/rainbow70626/p/17649814.html
在opencv-3.2.0/modules/videoio/src/cap_ffmpeg_impl.hpp,顶端添加如下代码:

#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
#define AVFMT_RAWPICTURE 0x0020
  • 1
  • 2
  • 3

Error 4:

make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/build.make:186: modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3151: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Fix:

来源:https://blog.csdn.net/qq_44357371/article/details/105966714
修改/opencv-3.2.0/modules/python/src2/cv2.cpp文件730行

修改
char* str = PyString_AsString(obj);
添加(char *)
char* str = (char *)PyString_AsString(obj);
  • 1
  • 2
  • 3
  • 4
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/119822?site
推荐阅读
相关标签
  

闽ICP备14008679号