我正在尝试编译 hidapi在 ubuntu 14.04 上与 node-hid 一起使用.当 hidapi 使用 hidraw 作为 this issue 时,由于某种原因,Node-hid 看不到任何设备描述。第四篇也给出了解决方案:
So, with my limited gcc/waf knowledge I managed to get it to build (I changed wscript to use ../hidapi/libusb/hid.c vs using /hidapi/linux/hid.c. I also changed its linkflags to use -lusb1.0 instead of -ludev and I added /usr/include/libusb-1.0 (a hardcoded path as the makefile wants to use pkgconfig to find that path.. I don't know an equivalent).
我已经设法将 wscript 文件中的/hidapi/linux/hid.c 更改为 ../hidapi/libusb/hid.c 并且我还找到了链接标志并进行了更改;但是,我不确定如何实现关于硬编码路径的最后一部分。我会在哪里写这条路?或者,是否有更好的方法让 node-hid 正常工作?
最佳答案
node-hid
不再使用 wscript,它现在有一个 binding.gyp 等等 node-gyp is used instead .同样默认the binding.gyp uses libusb
instead of hidraw
,所以这应该不是问题。
关于linux - 使用 libusb 而不是 hidraw 编译 hidapi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25925294/