我跟着Writing Node.js Native Extension成功创建了helloworld.node
文件。我可以成功拨打helloworld.node
。Node.js C++扩展部署
而且,我有打电话helloworld.node
一个test.js
。的test.js
内容是
var mhw = require('./helloworld/build/Release/helloworld');
var hw = new mhw.HelloWorld();
console.log(hw.hello());
但我得到Unable to load shared library
错误我感动helloworld.node
和test.js
到另一台计算机后。
hkalex(at)shellmix ~/nodetest> node test.js
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Unable to load shared library /homex/hkalex/nodetest/helloworld/build/Release/helloworld.node
at Object..node (module.js:463:11)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object.<anonymous> (/homex/hkalex/nodetest/test.js:1:73)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
hkalex(at)shellmix ~/nodetest>
我在开发计算机中使用root
。我正在使用shellmix
进行测试。
有什么想法吗?谢谢!
更新
如果我把源文件中shellmix
并从源代码编译,一切都很好。