zoukankan      html  css  js  c++  java
  • 解决两个OpenCV 报错 (raise.c and GTK) ,重新安装和编译

    error 1:

    Unable to open 'raise.c': Unable to read file '/build/glibc-S9d2JN/glibc-2.27/sysdeps/unix/sysv/linux/raise.c' (Error: Unable to resolve non-existing file '/build/glibc-S9d2JN/glibc-2.27/sysdeps/unix/sysv/linux/raise.c').

    error 2:

    window.cpp:1239: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage

     首先卸载opencv,最佳的卸载方式是找到opencv的安装路径,我的路径是 '~/opencv_build/' ,找到build文件夹 '~/opencv_build/opencv/build',这是安装时 make install 的目录,卸载只需要在这个路径下 sudo make uninstall  就可以完美卸载。

    (www.stackoverflow.com/questions/9276169/removing-all-installed-opencv-libs)

    OpenCV rebuild cmake command: (tested successful)

    cmake -D CMAKE_BUILD_TYPE=RELEASE 
    -D CMAKE_INSTALL_PREFIX=/usr/local 
    -D WITH_TBB=ON 
    -D BUILD_NEW_PYTHON_SUPPORT=ON 
    -D WITH_V4L=ON 
    -D WITH_QT=ON 
    -D WITH_GTK=ON 
    -D BUILD_TIFF=ON 
    -D WITH_CUDA=OFF 
    -D ENABLE_AVX=OFF 
    -D WITH_OPENGL=ON 
    -D WITH_OPENCL=OFF 
    -D WITH_IPP=OFF 
    -D BUILD_TBB=ON 
    -D WITH_EIGEN=OFF 
    -D WITH_VTK=OFF 
    -D BUILD_TESTS=OFF 
    -D BUILD_PERF_TESTS=OFF 
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules ..

    This cmake command is a combination of the solutions in the following 2 links:

    https://stackoverflow.com/questions/59126945/how-can-i-solve-unable-to-open-raise-c-errorvscode-linux

    https://stackoverflow.com/questions/28776053/opencv-gtk2-x-error

    To install OpenCV with custom build options on Linux (Ubuntu 18), please follow this link:

    https://linuxize.com/post/how-to-install-opencv-on-ubuntu-18-04/

    PS: remember to use  

    make -j16

    to make cmake process times faster. (The number is subject to your CPU core number. Mine is 16 core CPU).

    更新: raise.c 的错误可能来自于 cuda GPU: (nvidia-smi)

    Unable to determine the device handle for GPU 0000:65:00.0: GPU is lost.  Reboot the system to recover this GPU

    他们可以同时出现。解决方案:重启

  • 相关阅读:
    tomcat7控制台日志中文乱码
    zookeeper的使用demo(c#/java)
    【备忘】mybatis的条件判断用<choose>
    不忘初心,方得始终。内存数据刷新改造小记
    又见thrift异常之TApplicationException: Internal error processing..
    Linux Shell计划任务
    Linux Shell 信号
    Linux Shell自定义函数
    Linux Shell Break和Continue
    Linux Shell while循环和until循环
  • 原文地址:https://www.cnblogs.com/mrlonely2018/p/14893904.html
Copyright © 2011-2022 走看看