0

I am getting this exception below

Unable to load DLL 'cvextern': The specified module could not be found.

When the debugger comes to this line below

img = new Image<Bgr, byte>(bitmapImage);

I am using EMGU CV 3.2.0.2721 in the component project I created as a library.

Upon googling, I found this thread below, but I tried to change the CPU to X86 and also as 64, both of them doesn't work. I see that cvextern is not part of my "References" in C# project. I tried to add that cvextern dll (both 64 and x86 I tried), it says it can't add as its not C# dll.

unable to load cvextern in a c# project

Please guide me.

Jasmine
  • 5,186
  • 16
  • 62
  • 114

2 Answers2

0

The cvextern dll is native dll, it cannot be added to a managed project. So instead of adding it as a reference simply copy it to the bin folder and it will work because the emgu dlls are searching for it.

0

Not sure if this is your case, but what i encountered is the following scenario: The referenced, managed DLL (for instance emgu.cv.world) was set as "copy local" in the reference properties, because the managed dll uses the unmanaged it couldn't find it anymore. so what i end up doing is the folowing: set "copy local" to false and add the following to your app.config:

 <runtime>  
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">  
           <probing privatePath="Emgu;Emgu\x86;Emgu\x64"/>  
        </assemblyBinding>  
    </runtime>  

change the Emgu, and Emgu... directories to what is relevant in your case. also, the Emgu directory has to be inside your product directory i e

MyAwesomeProgram
-myprog.exe
-Emgu.CV.World.dll
-Emgu
--x64
---cvextern.dll
--x86
---cvextern.dll
Felix
  • 109
  • 2
  • 4