The type initializer for 'Emgu.CV.CvInvoke' threw an exception

前端 未结 11 2257
轮回少年
轮回少年 2020-11-29 10:17

I\'m getting this error

The type initializer for \'Emgu.CV.CvInvoke\' threw an exception.

when I try to use Emgu CV. I\'ve tried

相关标签:
11条回答
  • 2020-11-29 10:56

    you could using LD_LIBRARY_PATH to solve it:

    1. open the warning and check what lib your program lack

    2. locate the path

      $ locate # to find the library path

    3. In your IDE, set the environment variable LD_LIBRARY_PATH to the lib path,(I use monodevelop, the path is Run-->Run With-->Custom Parameters...)

    it work quit good now :)

    0 讨论(0)
  • 2020-11-29 10:59

    Found this on c#,VS 2017, emgu version 3.2.0.2682

    Tried a simple build on AnyCPU and received the bad format exception. So I tried x86 bad format exception because of possible suggestions in the comments. Finally I put it as x64 and it worked fine.

    0 讨论(0)
  • 2020-11-29 11:04

    Copy and paste all the unmanaged dlls in the bin folder of your EMGU installation to where your exe file is (Release or Debug folder of your project folder).
    In my case, unmanaged dlls are at "C:\Emgu\emgucv-windows-universal-cuda 2.9.0.1922\bin\x86"

    0 讨论(0)
  • 2020-11-29 11:04

    I Had the same problem in my 32 bit machine for 3 days. I resolved this by simply copying all dlls into system32 folder from the bin and x86 folders and it worked. It looks like there are dlls that depend on other dlls and the moment you transfer all it works. I did not have time to find out which one.

    0 讨论(0)
  • 2020-11-29 11:04

    For me problem was solved by clicking in Visual Studio:

    Menu -> Project -> Properties -> Build -> Prefer 32-bit.

    It must have been a problem with emgu (probably x86) and my OS x64).

    0 讨论(0)
提交回复
热议问题