Error with ffi module node.js Uncaught Error: Dynamic Linking Error: Win32 error 193

懵懂的女人 提交于 2019-12-24 01:38:17

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!