opencvsharp icon indicating copy to clipboard operation
opencvsharp copied to clipboard

DllNotFoundException: Unable to load DLL "OpenCvSharpExtern"

Open QingmingLi-LQM opened this issue 1 year ago • 4 comments

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.

QingmingLi-LQM avatar Apr 10 '23 15:04 QingmingLi-LQM

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?

suyashcjoshi avatar Apr 18 '23 19:04 suyashcjoshi

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?

Bartvelp avatar Apr 19 '23 08:04 Bartvelp

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.

stale[bot] avatar Dec 15 '23 06:12 stale[bot]

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

hoangdung3498 avatar Mar 05 '24 07:03 hoangdung3498