0
最も基本的な例を、自己のプロセスをインポートする場合でも、ノード自体のプロセスからそれをロードすることによってatoi
を呼んでいる: ダイナミックシンボル取得エラー:Win32エラー127 - ノード外部関数インタフェースで
var ffi = require('ffi');
var current = ffi.Library(null, {
'atoi': [ 'int', [ 'string' ] ]
});
console.log(typeof current.atoi('1234')); // 1234
しかし、私はこのエラーを取得します:
throw new Error('Dynamic Symbol Retrieval Error: ' + this.error())
^
Error: Dynamic Symbol Retrieval Error: Win32 error 127
at DynamicLibrary.get (D:\web\node_modules\ffi\lib\dynamic_library.js:112:11)
at D:\web\node_modules\ffi\lib\library.js:50:19
at Array.forEach (native)
at Object.Library (D:\web\node_modules\ffi\lib\library.js:47:28)
at Object.<anonymous> (D:\web\native\winapi.js:5:19)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
明らかに私自身のプロセスにアクセスしているので、32/64bitの非互換性には関係しません。だから正確に何が間違っていますか?
- プラットフォーム:Windowsの7x64
- ノード:V6.2.2
- FFI:2.2.0
- 参照:1.3.3
ドキュメントによると、nullを渡すことは、自分のプロセスから関数をリンクしていることを意味します。 –
このエラーは、ライブラリを自分でロードしていない場合は特に、32ビットシンボルを呼び出すことに関連している可能性があります。 –
確かに、私は、現在実行中のバイナリからのシンボルの読み込みは、x64とx32の競合を引き起こしてはならないと仮定しました。それは質問btwで書かれています。 –