簡體   English   中英

適用於Mac OS X 10.9.5的節點隱藏式構建

[英]node-hid building for mac os x 10.9.5

在Mac OS X 10.9.5上構建/使用node-hid有問題。 使用node-gyp構建良好。 我只有hidapi警告:

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/hidapi/hidapi/mac/hid.o
  ../hidapi/mac/hid.c:255:20: warning: comparison of integers of different signs:
  'CFIndex' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
            if (chars_copied == len)
                ~~~~~~~~~~~~ ^  ~~~
  ../hidapi/mac/hid.c:295:20: warning: comparison of integers of different signs:
  'CFIndex' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
            if (used_buf_len == len)
                ~~~~~~~~~~~~ ^  ~~~
2 warnings generated.

但是測試示例給出了dyld錯誤:

sh# node src/show-devices.js
dyld: lazy symbol binding failed: Symbol not found: _IOHIDManagerCreate
  Referenced from: /Users/me/Documents/node-hid-master/build/Release/HID.node
  Expected in: dynamic lookup

為什么找不到IOKit? 提前致謝

錯誤在binding.gyp文件中

改變了以下

  'conditions': [
    [ 'OS=="mac"', {
      'LDFLAGS': [
        '-framework IOKit',
        '-framework CoreFoundation'
      ],
      'xcode_settings': {
        'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
      }
    }],

對此

  'conditions': [
    [ 'OS=="mac"', {
      'LDFLAGS': [
        '-framework IOKit',
        '-framework CoreFoundation'
      ],
      'xcode_settings': {
        'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
        'OTHER_LDFLAGS': [
          '-framework IOKit',
          '-framework CoreFoundation'
        ],    
      }
    }],

它現在可以工作

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM