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
    即可解决问题

     
  • 相关阅读:
    WPF中回车后跳转至指定控件上
    WPF 中Devexpress GridControl无限高度问题
    WPF中使用DevExpress控件lookupedite
    [.Net 5.0] 10. WebApi 自托管(WinFrom、Wpf)
    [C#] 尝鲜.net6.0的C#代码热重载
    [WPF 学习] 18. 摄像头(肢解DirectShow)
    [WPF 学习] 17.WPF摄像头
    [WPF 学习] 16.WPF Bitmap to ImageSource的几种方式
    [opencv]吊诡的摄像头黑屏
    WPF 基于五点线性平滑曲线算法
  • 原文地址:https://www.cnblogs.com/kean0048/p/11046499.html
Copyright © 2011-2022 走看看