我一直在尝试制作一个使用 libmtp 执行某些功能的 nodejs-native-addon。我已经成功构建了应用程序,但是Library not loaded: /usr/local/lib/libmtp.9.dylib. Referenced from: /path/build/Debug/nbind.node. Reason: image not found
当我尝试在另一个未安装 libmtp 的 macbook 上运行它时,应用程序抛出错误。
这是我的binding.gyp文件:
{
"targets": [
{
"includes": [
"auto.gypi"
],
"sources": [
"src/native/mtp.cc"
],
"link_settings": {
"libraries": [
"-lmtp"
],
},
}
],
"includes": [
"auto-top.gypi"
],
}
我什至尝试在库选项中包含 dylib 文件
"link_settings": {
"libraries": [
"<(module_root_dir)/src/native/lib/libmtp.9.dylib"
]
}
但该应用程序无法以Library not loaded: /usr/local/lib/libmtp.9.dylib. Referenced from: /path/build/Debug/nbind.node. Reason: image not found
错误启动。
任何帮助将不胜感激。