ubuntu调用OpenCvSharp4 异常 Unable to load shared library ‘OpenCvSharpExtern‘ or one of its dependencies

最新推荐文章于 2023-12-23 22:01:30 发布
最新推荐文章于 2023-12-23 22:01:30 发布 阅读量212

System.TypeInitializationException: The type initializer for 'OpenCvSharp.Internal.NativeMethods' threw an exception.
---> System.DllNotFoundException: Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libOpenCvSharpExtern: cannot open shared object file: No such file or directory
at OpenCvSharp.Internal.NativeMethods.redirectError(CvErrorCallback errCallback, IntPtr userdata, IntPtr& prevUserdata)
at OpenCvSharp.Internal.ExceptionHandler.RegisterExceptionCallback()
at OpenCvSharp.Internal.NativeMethods.LoadLibraries(IEnumerable`1 additionalPaths)
at OpenCvSharp.Internal.NativeMethods..cctor()
--- End of inner exception stack trace ---
at OpenCvSharp.Internal.NativeMethods.imgcodecs_imread(String fileName, Int32 flags, IntPtr& returnValue)
at OpenCvSharp.Mat..ctor(String fileName, ImreadModes flags)

#查看依赖
root@sea-ubuntu:/home/hcrainc# ldd /usr/local/lib/libOpenCvSharpExtern.so
linux-vdso.so.1 (0x00007ffd57eab000)
libtesseract.so.4 => not found
libgtk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f1cb6a4f000)
libgdk-x11-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f1cb679a000)
libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f1cb647d000)
---
安装依赖

sudo apt update

sudo apt install libtesseract-dev

如果都不管

1可参考如下

RUN apt-get update && apt-get install -y \
    apt-utils \
    libgdiplus \
    libc6-dev \
    libgtk2.0-dev \
    libtbb-dev \
    libatlas-base-dev \
    libvorbis-dev \
    libxvidcore-dev \
    libopencore-amrnb-dev \
    libopencore-amrwb-dev \
    libavresample-dev \
    x264 \
    v4l-utils \
    libwebp-dev \
    tesseract-ocr \
    libtesseract-dev \
    libleptonica-dev \
    libtiff-dev \
    libavcodec-dev \
    libavformat-dev \
    libswscale-dev \
    libdc1394-22-dev \
    libxine2-dev \
    libv4l-dev \
    tesseract-ocr
                    ubuntu调用OpenCvSharp4 异常 Unable to load shared library ‘OpenCvSharpExtern‘ or one of its dependencies
                    OpenCvSharp4  linux
				
WNetWrap 一个小型的,无依赖的库,使用进行C ++中的HTTP(S)请求。 这仅适用于针对Windows的开发人员,他们需要轻量级的HTTPS解决方案而无需外部库(例如 。 基本的HTTP GET请求 # include < iostream> # include " wnetwrap.h " using namespace wrap ; using namespace std ; int main () req my_request; // GET method and firefox user agent used by default resp my_response = HttpsRequest ( " https://www.example.com/ " , my_request); cout << my_response. text << endl; //
Server Error in ‘/’ Application.  ——————————————————————————– Could not load file or assembly ‘AjaxPro.2’ or one of its dependencies. 拒绝访问。  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the erro
在C#中使用OpenCvSharp4出现无法加载 DLLOpenCvSharpExtern:找不到指定的模块。 或者提示“OpenCvSharp.NativeMethods”的类型初始值设定项引发异常 如以下图片的提示: 解决方法: 把缺少的OpenCvSharpExtern.dll放到Debug目录下,若没有OpenCvSharpExtern.dll可自行下载即可,提供NuGet下载方法: 再次运行程序,即可解决问题:
the type initializer for '' threw an exception 问题:程序启动时初始化主窗口类时,弹出该错误。调查:查看类的构造函数是否会有异常抛出。解决:去掉类的构造函数中可能出现的异常。 ////////////////////// 环境:windows 2003 x64,Oracle 10g x64,odp.net(正确安装),.net fram...
Qt,OpenCV,Mingw 只需要在.pro文件中加入opencv包的路径,例如 INCLUDEPATH += D:\Dependencies\opencv\mingw_build_qt\install\include #LIBS += D:\Dependencies\opencv\mingw_build_qt\lib\libopencv_*.a LIBS += D:\Dependencies\opencv\mingw_build_qt\install\x64\mingw\lib\libopencv_*.a
the firmware package(stm32cube fw_f4 v1.8.5)or one of its dependencies requires the presence of a specific version of software or components. This error usually occurs when the firmware package requires a particular version of the software to function properly. To resolve this issue, you can follow the steps below: 1. Verify the compatibility: Check if the firmware package (stm32cube fw_f4 v1.8.5) is compatible with your current software version. Ensure that you have the correct version of the firmware package for your software. 2. Update the software: If the firmware package requires a specific version of software or components, check if there is an available update for your software. Updating to the latest version may resolve the compatibility issue. 3. Install missing dependencies: If the error message mentions the need for dependencies, make sure to install them. These dependencies could be additional software or components required by the firmware package. Check the documentation or user manual of the firmware package for a list of required dependencies. 4. Seek support: If you have followed the above steps but still encounter the error, it is recommended to seek support from the firmware package's manufacturer or community. They can provide assistance in troubleshooting the issue or guiding you through the installation process. Remember to always backup your system and files before making any changes or updates to ensure the safety of your data. 请注意,在执行任何操作之前,一定要提前备份您的系统和文件,以确保您的数据安全。