Plugin cannot load on Windows 7 - Specified module cannot be found

Answered

Comments

5 comments

  • Avatar
    Anton Babinov

    Hi Usama,

    try to use dumpbin.exe tool to examine the dependencies of the compiled dll. dumpbin.exe usually comes with Visual Studio and you can find it in in tools directory(https://docs.microsoft.com/en-us/cpp/build/reference/dumpbin-reference?view=msvc-160).

    You can use it in command line like this:

    dumpbin /dependents some.dll

    Let's start by checking which dependencies are required by your dll files.

    What's strange is that the relatively simple stub_analytics_plugin sample (compiled on my same Windows 10 machine, Visual Studio 2019) is also giving the same error.

    So none of compiled plugins(stub and calipsa) working on Windows7 machine and calipsa plugin is working on Windows 10, but stub isn't working on Windows 10?

    VMS server folder has pre-compiled .dll for stub plugin located at plugin_optional directory. Could you please copy stub plugin from plugin_option to plugins to see if Windows will be able to load it?

    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello Usama,

    I guess, you are building the debug version of the plugin, and it works on your machine since all the debug libraries injected into the plugins .dll are present in your system. You can see library dependencies as Anton has described.

    Our urgent requirement is that we have a 64-bit Windows 7 server with DW Spectrum (Digital Watchdog) installed and are required to present a demo of the plugin on this server.

    Taking this into account, most probably you are copying the debug-built version of the plugin to another system, which does not have any needed debug libraries installed.

    Try to build the "Release" version of the plugin and see if the problem persists.

    0
    Comment actions Permalink
  • Avatar
    Usama Ashraf

    Hey Anton Babinov, Hey Andrey Terentyev

    stub and calipsa are both working on my Windows 10.
    None are working on Windows 7.

    Yes, the precompiled stub dll inside plugins_optional is working.

    I have two build configurations, x64-Debug and x64-Release...I've tried both and still the same problem. May be the toolset is the issue? (I don't exactly know what "toolset" is)


    Here is the output of dumpbin:

    Dump of file calipsa_analytics_plugin.dll
    File Type: DLL Image has the following dependencies:

    KERNEL32.dll
    ADVAPI32.dll
    MSVCP140.dll
    VCRUNTIME140.dll
    VCRUNTIME140_1.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-filesystem-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-utility-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll
    api-ms-win-crt-time-l1-1-0.dll
    WS2_32.dll
    SHELL32.dll

    Summary 1000 .00cfg 21000 .data 5000 .idata 2A000 .pdata 1D8000 .rdata 8000 .reloc 1000 .rsrc 4A0000 .text 1000 .tls
    0
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Usama,

    There is in dependencies a number of .dll from "Microsoft Visual C++ Redistributable" package.

    Make sure you have "Microsoft Visual C++ Redistributable" package installed in Windows 7.
    If having the package in Windows 7 is not possible, you could try to build a statically linked plugin binary.

    1
    Comment actions Permalink
  • Avatar
    Andrey Terentyev

    Hello Usama,

    What changes do I need to make to go from a DLL to a static, so to speak self-contained plugin (if I'm not mistaken)?

    In the Visual Studio it's set in the Properties of a project.

    Properties->C/C++ -> Code Generation -> Runtime library

    /MT is for linking dependencies statically. Be aware, the libraries to be linked have to provide statically linkable .lib files.

    For example, to statically link stub_analytics_plugin dependencies you need to set "/MT" for the "Runtime library" setting in the following projects:

    • stub_analytics_plugin
    • nx_kit
    • nx_sdk

     

    1
    Comment actions Permalink

Please sign in to leave a comment.