Thursday 28 May 2020

Using an external library

I have been able to use the FFI npm package to call methods in a .so file. Is it possible to configure the FFI npm packages to use a DLL file instead?This does not work:import ffi from 'ffi'; import ref from 'ref'; const int = ref.types.int; const testPlugin = ffi.Library( './lib.dll', { add: [int, [int, int]], }, ); const result = testPlugin.add(2,2); I get the error:/Users/desk/src/temp/node-cs-interop/service/node_modules/ffi/lib/dynamic_library.js:74 throw new Error('Dynamic Linking Error: ' + err) ^ Error: Dynamic Linking Error: dlopen(./lib.dll.dylib, 2): image not found at new DynamicLibrary (/Users/desk/src/temp/node-cs-interop/service/node_modules/ffi/lib/dynamic_library.js:74:11) Thnx

Submitted May 28, 2020 at 09:28PM by programmer-bob-99

No comments:

Post a Comment