如何将atomic,lm和lpthread库添加到binding.gyp文件?

时间:2019-02-15 04:27:35

标签: c++ atomic node-gyp

我需要在node-gyp项目的binding.gyp中添加latomic,lm,lpthread库

我尝试将库添加到“库”下,如下所示

'targets': [
    {
      'target_name': 'dut',
      'sources': ["<!@(node -p \"require('./getconfig.js').sources\")"],
      'include_dirs': ["<!@(node -p \"require('node-addon-api').include\")",
      "<!@(node -p \"require('./getconfig.js').libraries\")"
      ],
     'libraries': ["../obj_dir/verilator_global_libs.a",
              "../obj_dir/Vtop_elastic__ALL.a",
          "-lm",
          "-latomic",
          "-lstdc++",
          "-lpthread"],

      'dependencies': ["<!(node -p \"require('node-addon-api').gyp\")"],
      'cflags!': [ '-fno-exceptions' ],
      'cflags_cc!': [ '-fno-exceptions' ],
       'cflags' : [ '-std=c++11' ],


      'xcode_settings': {
        'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
        'CLANG_CXX_LIBRARY': 'libc++',
        'MACOSX_DEPLOYMENT_TARGET': '10.7'
      },
      'msvs_settings': {
        'VCCLCompilerTool': { 'ExceptionHandling': 1 },
      }
    }
  ]
}

我不断收到此错误

    error: ‘atomic’ in namespace ‘std’ does not name a template type
     std::atomic<bool> m_notified;  // Notification pending

0 个答案:

没有答案