Node.js中的ffi调用dll库时,若被调用的dll库中又链接了别的dll,怎么设置环境变量
var iopath2 = path.join(__dirname, 'imgateway.dll');
const dll2 = ffi.Library( iopath2, {
getTestVar:['int',[]],
setTestVar:[ref.types.void,['int']],
setTestVar2:[ref.types.void,['int']]
})
imgateway.dll中若没有引入dll,不会报错,但其中若有dll,就会报win32 126的错误,有说设置环境变量就可以,如何设置环境变量呀
通过设置 process.env.PATH =
${process.env.PATH}${path.delimiter}${myPath}
就能调用 了