3

我有 .lib 静态库 - windows。如何正确地将其包含到 node-gyp 项目中。我做到了,但我抓住了error LNK2001: unresolved external symbol。我想,我错误地添加了库。这个库是 tdlib(电报数据库库)。谢谢您的帮助!

我的 binding.gyp 文件

{
    "targets": [
      {
        
        "target_name": "td_json",
        "sources": [ "lib.cc" ],
        "libraries": [
          "<(module_root_dir)/td/build/Release/tdjson.lib"
          ],
        "include_dirs": [
          "<!(node -p \"require('node-addon-api').include_dir\")"
          ],
        'dependencies': [
            "<!(node -p \"require('node-addon-api').gyp\")"
        ],
        "copies": [
            {
              "destination": "<(module_root_dir)/build/Release/",
              "files": [
                "<(module_root_dir)/td/build/Release/tdjson.dll" ]
            }
        ],
        "cflags!": [ "-fno-exceptions" ],
        "cflags_cc!": [ "-fno-exceptions" ],
        'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS' ]
      }
    ]
  }
4

0 回答 0