shimat / opencvsharp

OpenCV wrapper for .NET
Apache License 2.0
5.22k stars 1.13k forks source link

DllNotFoundException: Unable to load DLL "OpenCvSharpExtern" #1558

Open QingmingLi-LQM opened 1 year ago

QingmingLi-LQM commented 1 year ago

Why when importing OpenCVSharp in the .NET Framework class library, it prompts DllNotFoundException: Unable to load DLL "OpenCvSharpExtern": The specified module cannot be found, but I have downloaded OpenCvSharpExtern.dll. I can use it normally in the .NET Framework Windows Forms project, but always report errors in the .NET Framework class library.

suyashcjoshi commented 1 year ago

I'm getting the same error on my Mac and looks like it's not build for M1 Apple Silicon architecture. Can the developer please fix that?

Bartvelp commented 1 year ago

I'm getting the same error on both linux-amd64 and linux-arm64. Even when adding the library manually using LD_LIBRARY_PATH=/snip/bin/Debug/net6.0/runtimes/ubuntu.18.04-x64/native/ it still gives the same error. When using ldd to check the required shared libraries it determines quite a few to be missing:

[10:03] bart@ubuntu:~/CsharpOpencv$ ldd bin/Debug/net6.0/runtimes/ubuntu.18.04-x64/native/libOpenCvSharpExtern.so
        linux-vdso.so.1 (0x00007ffd06bb2000)
        libtesseract.so.4 => not found
        libgtk-x11-2.0.so.0 => /lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 (0x00007f231aa00000)
        libgdk-x11-2.0.so.0 => /lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 (0x00007f231af3f000)
        libcairo.so.2 => /lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f231a8d8000)
        libgdk_pixbuf-2.0.so.0 => /lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f231edfe000)
        libgobject-2.0.so.0 => /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f231aedd000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f231a79e000)
        libdc1394.so.22 => not found
        libavcodec.so.57 => not found
        libavformat.so.57 => not found
        libavutil.so.55 => not found
        libswscale.so.4 => not found
        libjpeg.so.8 => /lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f231a71d000)
        libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f231aea5000)
        libtiff.so.5 => /lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f231a692000)
        libIlmImf-2_2.so.22 => not found

Why is OpenCV not compiled statically and included like in opencv-python?

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

hoangdung3498 commented 4 months ago

Why when importing OpenCVSharp in the .NET Framework class library, it prompts DllNotFoundException: Unable to load DLL "OpenCvSharpExtern": The specified module cannot be found, but I have downloaded OpenCvSharpExtern.dll. I can use it normally in the .NET Framework Windows Forms project, but always report errors in the .NET Framework class library.

do you solve it ?, i get same error with you