node-sharpを使用しようとしています-https ://github.com/anodejs/node-sharpを使用して、既存の.netアセンブリをロードします。これまでは機能させることができませんでした。「指定されたプロシージャが見つかりませんでした」というメッセージしか表示されないようです。
そこで、より簡単な例から始めて、このガイド( http://coderesearchlabs.com/articles/BNWCA.pdf)に従いました。同じ結果。
32ビットバージョンのNode.jsがインストールされているバージョン0.8.16のWindows64で実行しています。
エラースタックトレース-
> require("./Sharp").hello
Error: The specified procedure could not be found.
C:\Program Files (x86)\nodejs\Sharp.node
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 repl:1:2
at REPLServer.self.eval (repl.js:109:21)
at Interface.<anonymous> (repl.js:248:12)
at Interface.EventEmitter.emit (events.js:96:17)
at Interface._onLine (readline.js:200:10)
> console.log('Version: ' + process.version);
Version: v0.8.16
undefined
>
ソースは
#pragma comment(lib, "node")
#include <node.h>
#include <v8.h>
using namespace node;
using namespace v8;
extern "C" void NODE_EXTERN init (Handle<Object> target)
{
HandleScope scope;
target->Set(String::New("hello"), String::New("world"));
}
NODE_MODULE(test, init)