EmguCv 3.4.1 threw exception DllNotFoundException: Unable to load DLL 'cvextern': (Exception from HRESULT: 0x8007007E)

0

My test machine:

Operating system:

  • Windows 7 64 bit profersional version with SP1

.Net framework:

  • 4.5.1 installed

Others:

  • EmguCV 3.4.1.2976
  • Visual C++ Redistributable for Visual Studio 2015 x64
  • Visual C++ Redistributable for Visual Studio 2015 x86
  • Visual C++ Redistributable for Visual Studio 2013 x64
  • Visual C++ Redistributable for Visual Studio 2012 x64
  • Visual C++ Redistributable for Visual Studio 2012 x86
  • Visual C++ Redistributable for Visual Studio 2010 x64
  • Visual C++ Redistributable for Visual Studio 2010 x86

Error:

  • System.DllNotFoundException and the message is that "cvextern.dll cannot be loaded".

Code

Very simple code, just one line of code, complied by Microsoft Visual Studio 2015 Community against .net framework 4.5.1

Mat testMat = new Mat();

I developed the code in my laptop (win 10), it can run in my laptop, but failed in the test machine.

The second time to face this problem, months before had it but fixed by let all class library compiled as X64, and copy all x86, x64 folder and files to the Exe folder:

list of the Exe folder:

  • the_test.exe
  • the_test.exe.config
  • Emgu.CV.UI.dll
  • xml files...
  • Emgu.CV.World.dll
  • xml files...
  • ZedGraph.dll
  • xml files ...
  • x64(folder)
  • x86(folder)

There are five files from EmguCV 3.4.1 in the X86/X64 folder, with concrt140.dll, cxextern.dll, cvruntime140.dll, opencv_ffmepg_64.dll (x64 folder), and msvcp140.dll

And the Emgu.CV.UI.dll, Emgu.CV.World.dll, ZedGraph.dl and the related xml file, I complied Emgu.CV.UI.dll, Emgu.CV.World.dll as X64 in my laptop.

Before I post this, I have tried several links this this and EmguCV official wiki about this problem

As we know, the EmguCV officical wiki is very old and looks nobody update that site, I cannot find the solution from the wiki site.

I even tried to copy all opencv_xxxx_341d.dll (12 files) from opencv 3.4.1 to X64 or Exe folder but the error still remains.

And also, I used Dependency Walker to open cxextern.dll, all dll can be loaded except "IEShims.dll", this is almost the same as my laptop. it takes more than 2 minutes to load cxextern.dll in my laptop with an alert message, but in the test machine, it only takes 3 seconds to open cxextern.dll and without any alert message. all the two machine don't have "IEShims.dll".

Would you please to help me? Thanks in advance.

c#
opencv
dll
emgucv
asked on Stack Overflow Oct 11, 2018 by Ben

1 Answer

0

I am going to make the assumption here that you are using the EmguCV release without GPU support. It would look like emgucv-windesktop-icc-tbb-ipp 3.4.1.XXXX when unzipped. I run both the GPU and non-GPU versions. In either case I always compile for x64. I suppose it may not be necessary for the non-GPU version, but since I use both I just go ahead and compile for x64.

Now with that out of the way. If you are using the non-GPU version, you should copy the x64 folder from emgucv-windesktop-icc-tbb-ipp 3.4.1.2984\libs to your bin\debug folder of your main project. You should reference in the project using EmguCV, the following files:

  • Emgu.CV.DebuggerVisualizers.VS2015.dll
  • Emgu.CV.UI.dll
  • Emgu.CV.UI.GL.dll (optional)
  • Emgu.CV.World.dll
  • ZedGraph.dll

That should do it. A full example is at this Link

Hope this helps, Doug

answered on Stack Overflow Oct 30, 2018 by AeroClassics

User contributions licensed under CC BY-SA 3.0