zoukankan      html  css  js  c++  java
  • 安装opencv3.3.0碰到的问题及解决方法

    出处:http://osask.cn/front/ask/view/258965

    CMakeError.log

    Compilation failed:
        source file: '/home/jhros/opencv-3.3.0/cmake/checks/cxx11.cpp'
        check option: ''
    ===== BUILD LOG =====
    Change Dir: /home/jhros/opencv-3.3.0/build/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTC_f915e/fast"
    /usr/bin/make -f CMakeFiles/cmTC_f915e.dir/build.make CMakeFiles/cmTC_f915e.dir/build
    make[1]: Entering directory '/home/jhros/opencv-3.3.0/build/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_f915e.dir/cxx11.cpp.o
    /usr/bin/c++      -o CMakeFiles/cmTC_f915e.dir/cxx11.cpp.o -c /home/jhros/opencv-3.3.0/cmake/checks/cxx11.cpp
    /home/jhros/opencv-3.3.0/cmake/checks/cxx11.cpp:4:2: error: #error "C++11 is not supported"
     #error "C++11 is not supported"
      ^
    /home/jhros/opencv-3.3.0/cmake/checks/cxx11.cpp: In function ‘int main()’:
    /home/jhros/opencv-3.3.0/cmake/checks/cxx11.cpp:11:10: error: ‘res’ does not name a type
         auto res = test();
              ^
    /home/jhros/opencv-3.3.0/cmake/checks/cxx11.cpp:12:12: error: ‘res’ was not declared in this scope
         return res;
                ^
    CMakeFiles/cmTC_f915e.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_f915e.dir/cxx11.cpp.o' failed
    make[1]: *** [CMakeFiles/cmTC_f915e.dir/cxx11.cpp.o] Error 1
    make[1]: Leaving directory '/home/jhros/opencv-3.3.0/build/CMakeFiles/CMakeTmp'
    Makefile:126: recipe for target 'cmTC_f915e/fast' failed
    make: *** [cmTC_f915e/fast] Error 2

    如果碰到以上问题,请检查编译器,如果不是gcc7(不知道6可不可以)请升级到7 即可

    Build output check failed:
        Regex: 'command line option .* is valid for .* but not for C++'
        Output line: 'cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++'
    Compilation failed:
        source file: '/home/jhros/opencv-3.3.0/build/CMakeFiles/CMakeTmp/src.cxx'
        check option: ' -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations  -Wmissing-prototypes

    如果有如下问题,请在编译选项添加
    CMAKE_C_COMPILER=/usr/bin/gcc-7
    即可解决问题

     
  • 相关阅读:
    【BZOJ3309】DZY Loves Math(莫比乌斯反演)
    【CF666E】Forensic Examination(后缀自动机,线段树合并)
    【HDU5730】Shell Necklace(多项式运算,分治FFT)
    【洛谷4389】付公主的背包(生成函数,多项式运算)
    【CF528D】Fuzzy Search(FFT)
    【BZOJ4259】残缺的字符串(FFT)
    【BZOJ4503】两个串(FFT)
    【CF954I】Yet Another String Matching Problem(FFT)
    Java中泛型Class<T>、T与Class<?>、 Object类和Class类、 object.getClass()和Object.class
    H5和原生APP之间的区别
  • 原文地址:https://www.cnblogs.com/kean0048/p/11046499.html
Copyright © 2011-2022 走看看