1

I'm trying to install some important software related to my work (on Windows 10), but when I try to run it an error pops up saying that opencv_core245.dll & opencv_ml245.dll are missing.

I have tried googling but the only results I got were dodgy websites and some viruses.

How can I fix this issue?

EDIT: The software I am attempting to run is the TITARL application found here

3
  • 1
    The software should provide its dependencies, so they should at least mention how to get it somewhere (README.txt?) if they don't bundle it. – T Nierath May 17 '18 at 15:06
  • @TNierath I've scoured the README.txt, nothing in there though there are some contact details... I'll keep those as a last resort – Jessica Chambers May 17 '18 at 15:09
  • As the answer says, opencv is a well known library. You can try checking if they provide builds with the suitable version number (2.45?). But windows is quite messy when it comes to binary compatibility so dll's are normally provided with the binary itself. Good luck. – T Nierath May 17 '18 at 15:13
0

An error pops up saying that opencv_core245.dll and opencv_ml245.dll are missing.

These are related to the OpenCV (Open Source Computer Vision) Library. You may wish to try installing that first.

Installation Notes

  • The OpenCV extractor for Windows (currently packaged as an .exe) will prompt for a path to extract to when run. An opencv folder is created automatically at that location.

  • In a broad sense, it shouldn't matter where you choose to extract these file. However, your program may have specific requirements (which you will need to verify) as to the placement of the missing .dlls.

  • Some programs may require a path to the library to be defined in their settings while others may require you to manually place files e.g. in their program folder(s) (or other locations). You will need to confirm which of these options apply through your program documentation or further research.

  • OpenCV comes with a number of builds. You should match the "bitness" of your selected library .dlls to the "bitness" of your program (i.e. 32-bit or 64-bit).

TITARL

For TITARL, the missing .dlls need to placed in the same folder as TITARL.exe:

OpenCV DLL Placement - Screenshot

opencv_core245.dll And opencv_ml245.dll

Unfortunately, OpenCV 2.4.5 (and these .dlls) no longer seem easily available as pre-compiled binaries. However, the OpenCV 2.4.5 Library is still available as source code from the official GitHub repository. The missing .dlls need to be compiled from this source code before the program will run.

If you trust strangers on the internet, I have compiled 64-bit versions of these two .dlls for you. They seemed to work correctly with the example_learning.bat provided with TITARL. However, they have not been thoroughly tested by any means.

Caveats

  • These .dlls were built with Visual Studio 14 (2015) on Window 7 with no Python support.

  • Support for FFmpeg and DirectShow were included in the build options but have not been directly tested in any way.

  • No other .dlls were built besides opencv_core245.dll and opencv_ml245.dll.

If you do decide to try these and run into trouble (e.g. unexplained behaviors or other issues), you may simply need to compile them yourself. I give an overview of the steps I took below.


Mini-Compilation Guide for Visual Studio

Based on this general guide to compiling OpenCV 3 with Visual Studio, which you have mentioned in the comments, the following steps should allow you to get at least a minimally functioning installation of TITARL by building the necessary missing .dlls.

Preparation

  1. Download and install Microsoft Visual Studio Community Edition (free). They have older versions as well, depending on your needs. Be aware that older versions currently require a free Dev Essentials account to access.

  2. Download and install CMake. CMake is a utility that helps compilation go a bit easier and OpenCV 2.4.5. has the necessary files to work with it.

  3. Download and extract the source code linked earlier (if you haven't already done so). Where you extract the source code is your choice.

  4. Assuming CMake is installed, open the GUI interface (e.g. from the icon on your desktop).

  5. At the top of the main window, enter the path to your source code in the first field. In the secondary field just below, add a path to where you would like to store files related to compilation (the location of this second path is your choice). Throughout these steps, I will be using a folder called build, located in the same directory as the source code:

    CMake/OpenCV Build Directory - Screenshot

  6. Once these paths are entered, press Configure near the bottom of the main window. A new dialog box should appear.

  7. In this dialog box, select the correct "generator" for your .dlls. For Visual Studio, this will be the edition name followed by either nothing (which builds 32-bit binaries) or Win64 (which builds 64-bit binaries). TITARL is a 64-bit program (TITARL 1.7 [Win x64 - Public release]), therefore you will want to select e.g Visual Studio 14 2015 Win64 or Visual Studio 15 2017 Win64 to build the appropriate 64-bit .dlls:

    CMake Generator - Visual Studio 14 2015 Win64 - Screenshot CMake Generator - Visual Studio 15 2017 Win64 - Screenshot

  8. Press Finish to close the dialog box. CMake will automatically begin processing the OpenCV 2.4.5 source code. In the main window, the Configure button will have changed to a Stop button and the Generating... and Open Project... buttons next to it will be grayed out. Note that this initial processing may take a few minutes.

  9. Once this processing is completed, the upper pane in the main CMake window will display a large amount of information in red (these are newly-detected options). The lower pane should read "Configuring done":

    CMake Initial Processing Completed

  10. Find the build options marked BUILD_opencv_* (where * is a name such as apps). They should all be in one block. Uncheck the checkbox next to each item, excluding BUILD_opencv_core and BUILD_opencv_ml. Press Configure again. After processing finishes once more, press Generate.... When completed, the main CMake window should look something like this:

    CMake - Ready To Visual Studio Edit Solution - Screenshot

Fixing OpenCV 2.4.5

Normally, everything would be ready for compiling the missing .dlls at this point. However, OpenCV 2.4.5. has a generic issue with Visual Studio 12+ where it generates a large number of "max" : is not a member of "std" errors, which prevent the necessary .dlls from being created.

Thankfully, as detailed in an answer to this StackOverflow question, compilation can be achieved with some minor alterations to the original source code.

To fix this issue:

  1. Find the OpenCV.sln solution generated by CMake earlier (e.g. under C:\path\to\opencv-2.4.5\build).

  2. Double-click the file to open it in Visual Studio. Since this is likely the first time you've opened this solution, it may take a minute or two for Visual Studio to fully parse it. Watch the blue activity bar at the bottom of the main Visual Studio window and wait till it says "Ready" before continuing.

  3. Once Visual Studio has settled down, press Ctrl + H to open the Find and Replace dialog box, then do the following:

    • Under Find what: enter #include \<string\>.
    • Under Replace with: enter #include <algorithm>\n#include <string>.
    • Set Look in to Entire Solution (as needed).
    • Under Find options, make certain Use Regular Expressions is marked.
    • Press Replace All when finished.

      Visual Studio Solution Replacement Dialog - Screenshot

Compiling

Once all the steps above are complete, you should be ready to compile with CMake. Open a command window in your build directory (ex. C:\path\to\opencv-2.4.5\build) and type e.g.:

C:\path\to\cmake.exe --build . --config Release --target INSTALL

After short time (under 15 minutes), compiling should be completed and the missing .dlls should be available under the install\bin folder of the build directory (e.g C:\path\to\opencv-2.4.5\build\install\bin). As noted earlier, the .dlls in this folder need to placed in the same folder as TITARL.exe.


General Notes

  • Following the steps above, I encountered no major errors beyond the necessary code correction with Visual Studio. However, I did not attempt to build the entire library.

  • Not every step presented here exactly mirrors the steps given in the guide links. You may wish to refer back to those links for additional details.

Visual Studio Notes

  • Visual Studio can be a large installation and may need configuration in its own right. Therefore, Preparation Step 1 may take longer than you might otherwise think.

  • If you plan to tinker with Python support in OpenCV, Visual Studio may need to be setup with Python Tools for Visual Studio along with its support for Visual C++.

  • Yellow warning messages during compilation can often be safely ignored. Red error messages, on the other hand, indicate problems that will cause a build to fail (i.e. no .dlls will be produced). However, these are not the same as the potentially "safe" red errors CMake generates below.

CMake Notes

  • CMake uses / not \ for Windows paths in its GUI interface. That said, pasted paths should have any \ switched to / automatically.

  • If you do not wish to type the full path to cmake.exe in the final compilation step, choose the option to add CMake to your PATH during its installation.

  • The option to build .dlls supporting Python in CMake requires steps which are not listed here.

  • Preparation Step 7 can cause incorrect binaries to be built if you select the wrong generator (i.e. 32-bit .dlls will not work with a 64-bit program). Leaving the radio button option as Use default native compilers should be fine, however.

  • If you make any mistakes with CMake, etc., simply delete your build folder and start again from Preparation Step 4.

  • In CMake, with the steps given, red "errors" in the interface did not seem to cause any serious issues. That said, its probably worthwhile to generally note any error or warning you encounter.

  • If there are any serious issues, configuration will not complete and an error log will be written.

9
  • Once I've downloaded it, where should I extract the files to? Does it matter? – Jessica Chambers May 17 '18 at 15:22
  • Apologies. In a broad sense, it shouldn't matter -- wherever you believe is suitable overall. I would be tempted to put it somewhere with my other programs or libraries (the executable extractor creates an opencv folder automatically). – Anaksunaman May 17 '18 at 17:18
  • That said, for your program, it may either have an option to specify a path to the library or require the appropriate .dlls be placed in one (or more) of its program folders. If you need to manually place them, the root folder or perhaps any bin folder are likely targets. However, that is a guess. You may need to re-read the documentation for your program or do further research. Note that you should use either the x32 (32-bit) or x64 (64-bit) versions of these .dlls based on the "bitness" of the program you are attempting to run (ie. again, 32-bit or 64 bit). – Anaksunaman May 17 '18 at 17:21
  • ok I have installed openCV (followed this tutorial: learnopencv.com/install-opencv3-on-windows )and still no luck. I ended up going down a rabbit hole of installations including dlib and MSBuild. The doc doesn't have any information about the requirements etc either – Jessica Chambers May 18 '18 at 13:05
  • If you continue having issues, you may want to consider adding a few more details about which program(s) you're using (if possible) and how (i.e. What would you like to do with it or them). – Anaksunaman May 18 '18 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.