2

I'm using opencv_java400-x64.dll provided by the OpenCV release. It works well on my system (Windows 10 Pro). On other user's system's (usually Windows 7) some of them cannot load the DLL and receive the error java.lang.UnsatisfiedLinkError: C:\...path...\opencv_java400-x64.dll: Can't find dependent libraries.

Since no specific details are provided by the error message I'm wondering which DLLs are actually missing so I can supply/install them. When using the Visual Studio command prompt tools, I get the following output:

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.8.3
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise>dumpbin /dependents "C:\...path...\opencv_java400-x64.dll"
Microsoft (R) COFF/PE Dumper Version 14.15.26726.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\...path...\opencv_java400-x64.dll

File Type: DLL

  Image has the following dependencies:

    MSVFW32.dll
    AVIFIL32.dll
    AVICAP32.dll
    ole32.dll
    KERNEL32.dll
    USER32.dll
    OLEAUT32.dll
    MFPlat.DLL
    MF.dll
    MFReadWrite.dll
    d3d11.dll
    api-ms-win-downlevel-shlwapi-l1-1-0.dll

  Summary

       F6000 .data
        1000 .gfids
       DF000 .pdata
      819000 .rdata
       18000 .reloc
        1000 .rsrc
     21C8000 .text
        1000 .tls
      25B000 IPPCODE
        B000 IPPDATA
       15000 _RDATA

The dependent DLLs are listed however I still don't know which ones may be missing. I realized that installing Visual C++ fixes this problem in some cases but not all. The OpenCV specific search results on Google are not clear on solving this problem (e.g. this doesn't work either). What's the proper way of making this particular DLL work on any Windows based operating system?

Additional information on what I tried in this OpenCV repository issue.

BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185

1 Answers1

2

It turns out the api-ms-win-downlevel-shlwapi-l1-1-0.dll was missing. Supplying it fixed the problem. See this link for more information.

BullyWiiPlaza
  • 17,329
  • 10
  • 113
  • 185
  • I have the same problem on Windows 10. What is strange is that the OS does not seem to have this dll (I searched with find from Git for Windows). Any idea ? – Gabriel Devillers May 07 '19 at 08:41
  • so I copied `C:\Windows\SysWOW64\downlevel\api-ms-win-core-shlwapi-legacy-l1-1-0.dll` to `api-ms-win-downlevel-shlwapi-l1-1-0.dll` (in my executable's directory), and it seems to work. I found this candidate dll by searching `find /c/Windows -iname "*shlwapi*"`. By the way this is to package with cpack a software that uses OpenCV 4.0.0 DLLs. – Gabriel Devillers May 07 '19 at 11:31