尝试将我的共享库链接到节点包装器并收到此错误:
Error: Dynamic Linking Error: /home/jonahren/nmayya/ToroDll/libToroNew.so: invalid ELF header
at new DynamicLibrary (/home/jonahren/nmayya/ToroDll/node_modules/ffi/lib/dynamic_library.js:74:11)
at Object.Library (/home/jonahren/nmayya/ToroDll/node_modules/ffi/lib/library.js:45:12)
at /home/jonahren/nmayya/ToroDll/wrapper.js:22:23
at Layer.handle [as handle_request] (/home/jonahren/nmayya/ToroDll/node_modules/express/lib/router/layer.js:95:5)
at next (/home/jonahren/nmayya/ToroDll/node_modules/express/lib/router/route.js:137:13)
at /home/jonahren/nmayya/ToroDll/node_modules/body-parser/lib/read.js:130:5
at invokeCallback (/home/jonahren/nmayya/ToroDll/node_modules/raw-body/index.js:224:16)
at done (/home/jonahren/nmayya/ToroDll/node_modules/raw-body/index.js:213:7)
at IncomingMessage.onEnd (/home/jonahren/nmayya/ToroDll/node_modules/raw-body/index.js:273:7)
at emitNone (events.js:106:13)
这是我调用库的代码:
var libToro = ffi.Library('/home/jonahren/nmayya/ToroDll/libToroNew', {
'processText': [voidType, [CString, CString, CString, CString]]
})