私は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());
あるしかし、私は別のコンピュータにhelloworld.node
とtest.js
を移動した後、私はUnable to load shared library
エラーを得ました。
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
でソースファイルを入れて、ソースからコンパイルする場合、すべてが正常です。