C++/Node.js :binding. gyp 库失败

标签 c++ node.js unresolved-external node.js-addon

我在 Visual Studio 2015 中的 Windows 7 上创建了一个 C++ 程序,它使用 EnumProcessModules。 当我在 VS2015 中编译它时,它成功了。

现在,我在 Node.js 中创建了一个 C++ 插件,其中包含上述代码 (EnumProcessModules)。

当我从命令行编译它时(通过运行 node-gyp build),我得到以下错误:

LINK : fatal error LNK1181: cannot open input file 'psapi.dll' [C:\Users\Yoni\W
ebstormProjects\my_prog\build\getProcesses.vcxproj]

psapi.dll 存在于

C:\Users\Yoni\WebstormProjects\my_prog\

我从 C:\Windows\System32\ 中获取了它

这是我的 binding.gyp 代码:

{
  "targets": [
    {
      "target_name": "getProcesses",
      "sources": [ "psInfo.cc", "json.hpp" ],
      "libraries": [ "psapi.dll" ]
    }
  ]
}

如何解决?

感谢您的帮助。

最佳答案

我相信您需要在 “库” 列表中使用 "psapi.lib" 而不是 "psapi.dll" .

关于C++/Node.js :binding. gyp 库失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42020494/

相关文章:

c++ - 没有 LegacyRandomAccessIterator 的迭代器范围的平衡分区

c++ - 引用参数为 : how it works? 的子函数

c++ - 插件架构中的 Qt Signal 插槽

c++ - 什么是 undefined reference /未解析的外部符号错误,我该如何解决?

c++ - 如何验证用户登录到域或本地

javascript - 设置要运行的 NodeJS 脚本的计划作业

node.js - 如何在 node.JS 项目上使用 Cassandra CLI?

node.js - 我收到 SQLITE_Error : no such column, 但它存在为什么?

c++ - 什么是 undefined reference /未解析的外部符号错误,我该如何解决?

c++ - 什么是 undefined reference /未解析的外部符号错误,我该如何解决?