I am trying to write a C ++ module for Node Js for a USB device. This is the USB-IIRO-16 accesio input / output board (accesio.com/MANUALS/USB-IIRO-16.PDF). I have linux drivers installed along with libusb on Ubuntu 12.04 LTS. I have examples of applications (written in C ++) that work fine with the I / O board, and I can communicate with it just fine in C ++. I am new to writing nodejs modules and have not written C ++ since college. I also compile a module. I use the USBDeviceManager class provided by accesio, which they use in their sample application.
I used this as the basis for the module: https://github.com/kkaefer/node-cpp-modules/tree/master/06_objects
I replaced the hpp file with the USBDeviceManager provided by accesio, which is used in the sample application, and added ObjectWrap
class USBDeviceManager : public node::ObjectWrap {...}
The rest is the same as the USBDeviceManager along with sample module code. Everything compiles fine, however, when I run Node run.js, I get:
module.js:485 process.dlopen(filename, module.exports); ^ Error: /home/parallels/Documents/node-accesio/build/Release/accesio.node: undefined symbol: _ZTVN6AIOUSB16USBDeviceManagerE at Object.Module._extensions..node (module.js:485:11) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:362:17) at require (module.js:378:17) at Object.<anonymous> (/home/parallels/Documents/node-accesio/run.js:1:77) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12)
I tried a lot of moving code and some online documentation, but can't figure out what to do at the moment. The cpp and js files are still the same as the sample module application ( https://github.com/kkaefer/node-cpp-modules/tree/master/06_objects ). the only thing that differs by adding the USBDeviceManager to the hpp file and the AIOUSB namespace.
Basically what I want to do is the ability to read / write to the I / O board, similar to the sample application found here: http://accesio.com/files/packages/AIOUSB-Latest.tar.gz
source share