问题
I want to call a function, which is written in "C" DLL, from node.js JavaScript. I am using "ffi" module in node.js and electron. The function which I want to call is "int FDColor_GetSWVersion(char* softwareVersion)". I am using the below code:
var libm = ffi.Library(__dirname + "\\viewmodels\\FDColor.dll", {
'FDColor_GetSWVersion': [ 'int', ['string' ] ]
});
But I am getting the error:
Uncaught Error: Dynamic Linking Error: Win32 error 193
回答1:
It looks like that error means you have a 32/64 bit mismatch. You need to build the dll to match the loading process.
回答2:
I chose the 64-bit DLL and loaded it successfully
来源:https://stackoverflow.com/questions/38843150/error-with-ffi-module-node-js-uncaught-error-dynamic-linking-error-win32-error