zoukankan      html  css  js  c++  java
  • ubuntu亲测安装opencv和成功解决Makefile:160: recipe for target 'all' failed make: *** [all] Error 2

    1.因为项目需要,我安装的是opencv3.0.0,从github上面下载的opencv包

      git clone https://github.com/Itseez/opencv.git

      git clone https://github.com/Itseez/opencv_contrib.git  #opencv_contrib可以省略,不过安装上更全,有足够的时间的话,建议安装.

    两个都下载完以后,将opencv_contrib放到opencv文件夹下面,并安装依赖项:

    sudo apt-get install build-essential
    sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
    sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
    将上面依赖性安装成功以后,进入到opencv目录下,在终端输入命令 
    mkdir build;
    cd build;
    接下来就可以准备编译了.
    cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..

     报了这样的错误Makefile:160: recipe for target 'all' failed make: *** [all] Error 2

     网上说存在一些冲突因为我电脑装了anaconda,所以换条命令:

     cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_SHARED_LIBS=OFF -D WITH_OPENMP=ON -D ENABLE_PRECOMPILED_HEADERS=OFF ..

    这样就成功了...

    接下来执行make -j8或make -j4

    编译完毕之后执行 sudo make install

    以后步骤就完成了.仅供大家参考

  • 相关阅读:
    ufw防火墙设置
    [从0到1搭建ABP微服务]
    .Net Core CI/CD环境搭建(正式版)
    [Abp vNext微服务实践]
    [Abp vNext微服务实践]
    [Abp vNext微服务实践]
    [Abp vNext微服务实践]
    [Abp vNext微服务实践]
    [Abp vNext微服务实践]
    [Abp vNext微服务实践]
  • 原文地址:https://www.cnblogs.com/zgl19991001/p/14097003.html
Copyright © 2011-2022 走看看