Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ module by node-gyp in win10, call LoadLibrary Failed #2526

Closed
zengdongbao opened this issue Mar 14, 2020 · 2 comments
Closed

C++ module by node-gyp in win10, call LoadLibrary Failed #2526

zengdongbao opened this issue Mar 14, 2020 · 2 comments

Comments

@zengdongbao
Copy link

  • Node.js Version: 12.3
  • OS: windows 10
  • Scope (install, code, runtime, meta, other?): addon

I write a native C++ module(name: MyCppModule) by node-gyp,it work ok,but now I have another DLL, so I call LoadLibrary(“myDLL.dll”) in “MyCppModule”,but it not work, it return NULL, GetLastError return 126, means not found the module, if I call LoadLibrary(“myDLL.dll”) in other program, it work, need help

same as microsoft/nodejs-guidelines#92

issue

@NickNaso
Copy link
Member

Hi @zengdongbao,
could you post your binding.gyp file? Maybe you only need to set the shared libraries that you want use on your binding.gyp like reported on the following example:

{
  "targets": [
    {
      "target_name": "addon",
      "sources": [ "addon.cc" ],
      "lbraries": [
         // Set the path of your shared library or dll
      ]
    }
  ]
}

I hope that this could help you.

@zengdongbao
Copy link
Author

I think i found the reason. the target library link another dll, but the %PATH% not include directory yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants