Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build on ubuntu 20.04 #1388

Closed
CpBobette opened this issue Feb 6, 2022 · 4 comments
Closed

Unable to build on ubuntu 20.04 #1388

CpBobette opened this issue Feb 6, 2022 · 4 comments

Comments

@CpBobette
Copy link

Summary of your issue

I am trying to setup my for .net6 on ubuntu 20.04, I was unable to build from source (probably from missing dependencies but I just gave up). I am now trying to go the docker way but once again the DockerFile fails on the OpencvSharp build with errors related to wechat_qrcode.

/opencvsharp/src/OpenCvSharpExtern/include_opencv.h:64:10: fatal error: opencv2/wechat_qrcode.hpp: No such file or directory

Environment

ubuntu 20.04

@CpBobette
Copy link
Author

#1389

@64J0
Copy link

64J0 commented Feb 17, 2022

Cool, I'm trying to use it in Ubuntu 20.04 as well and it is not working either. Getting this message:

Unhandled exception. 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.videoio_VideoCapture_new3(Int32 device, Int32 apiPreference, IntPtr& returnValue)
   at OpenCvSharp.VideoCapture..ctor(Int32 index, VideoCaptureAPIs apiPreference)
   at <StartupCode$example-opencv>.$Program.main@() in /home/gajo/Desktop/codes/example-opencv/Program.fs:line 3

@CpBobette
Copy link
Author

You need to have OpenCvSharpExtern in your path or in your bin, have a look into the dockerfile, it will provide the instructions needed to build OpenCv and the wrapper library from source. You can than reference the compiled file in your project. I find using docker much easier when working with OpenCvSharp on ubuntu.

@64J0
Copy link

64J0 commented Feb 19, 2022

Cool, thanks for the tip @CpBobette

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants