MacOS runtime error (Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies)
See original GitHub issueSummary of your issue
Hi I tried use OpenCVSharp in my MacOS F# project. I added OpenCvSharp4.runtime.osx.10-15-x64 in my solution
Environment
MacOS 10.15.4, Visual Studio for Mac 8.5.6 (build 11)
Example code:
open OpenCvSharp
open System
[<EntryPoint>]
let main argv =
let src = new Mat("cat.jpg", ImreadModes.Grayscale); // <<----- Exception is here
// Mat src = Cv2.ImRead("lenna.png", ImreadModes.Grayscale);
let dst = new Mat();
let in1 = InputArray.Create(src)
let in2 = OutputArray.Create(dst)
Cv2.Canny(in1, in2, 50., 200.);
use w1 = new Window("src image", src)
use w2 = new Window("dst image", dst)
Cv2.WaitKey() |> ignore
0 // return an integer exit code
Output:
"Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libOpenCvSharpExtern, 1): image not found"
What did you intend to be?
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
'OpenCvSharp.NativeMethods' threw an exception. Unable ...
'OpenCvSharp.NativeMethods' threw an exception. Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies., Ubuntu 18.04.
Read more >MacOS runtime error (Unable to load shared library ' ...
I get Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies constantly while trying to create Mat object.
Read more >opencvsharp
To use OpenCvSharp, you should add both OpenCvSharp4 and OpenCvSharp4.runtime.* packages to your project. Currently, native bindings for Windows, UWP and Ubuntu ...
Read more >Net Core App with OpenCV4 in Mac os
DllNotFoundException : Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies. In order to help diagnose loading ...
Read more >OpenCvSharp.NativeMethods' threw an exception. Unable to ...
[Solved]-'OpenCvSharp.NativeMethods' threw an exception. Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies., Ubuntu 18.04-docker.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@vlozhnikov @shimat Could we re-open this one? I’m having the same issue and am not able to resolve it.
My Environment: MacOS Big Sur 11.6, Visual Studio Code v1.63.2, Visual Studio for Mac 2022 Preview v17.0 Build 5186
I’ve tried the following:
brew install wget pkg-config mono-libgdiplus gtk+ ffmpeg glog yasm harfbuzz jpeg libpng libtiff openexr openjpeg metis openblas opencore-amr protobuf tbb webp
libOpenCvSharpExtern.dylib
library to the root of the projectHowever, still getting the error:
Any other thoughts?
I’m also on MacOs with exactly the same symptoms described here, but I’ve been stuck on this error for a while.