【问题标题】:Identifying missing DLLs for OpenCV using Java Bindings使用 Java 绑定识别 OpenCV 丢失的 DLL
【发布时间】:2018-11-01 12:01:11
【问题描述】:

我正在使用OpenCV release 提供的opencv_java400-x64.dll。它在我的系统上运行良好 (Windows 10 Pro)。在其他用户的系统(通常为Windows 7)上,其中一些无法加载DLL 并收到错误java.lang.UnsatisfiedLinkError: C:\...path...\opencv_java400-x64.dll: Can't find dependent libraries.

由于错误消息没有提供具体细节,我想知道实际上缺少哪个DLLs,所以我可以提供/安装它们。 When using the Visual Studio command prompt tools,我得到以下输出:

**********************************************************************
** 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

列出了依赖的DLLs,但我仍然不知道哪些可能会丢失。我意识到安装Visual C++ 在某些情况下解决了这个问题,但不是全部。 Google 上的OpenCV 特定搜索结果并不清楚解决这个问题(例如this 也不起作用)。使这个特定的DLL 在任何基于 Windows 的操作系统上工作的正确方法是什么?

关于我在this OpenCV repository issue 中尝试的其他信息。

【问题讨论】:

    标签: java windows opencv dll


    【解决方案1】:

    原来api-ms-win-downlevel-shlwapi-l1-1-0.dll 不见了。提供它解决了这个问题。有关详细信息,请参阅this 链接。

    【讨论】:

    • 我在 Windows 10 上遇到了同样的问题。奇怪的是操作系统似乎没有这个 dll(我从 Git 中搜索了 Windows 的 find)。有什么想法吗?
    • 所以我将C:\Windows\SysWOW64\downlevel\api-ms-win-core-shlwapi-legacy-l1-1-0.dll 复制到api-ms-win-downlevel-shlwapi-l1-1-0.dll(在我的可执行文件的目录中),它似乎可以工作。我通过搜索 find /c/Windows -iname "*shlwapi*" 找到了这个候选 dll。顺便说一句,这是用 cpack 打包一个使用 OpenCV 4.0.0 DLL 的软件。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-06
    • 2016-03-17
    • 2016-12-27
    • 1970-01-01
    • 1970-01-01
    • 2011-01-03
    相关资源
    最近更新 更多