捆绑包和 dylib 查找
我的 .app 包如下所示:
MyApp.app/
Contents/
MacOS/
MyApp
libA.dylib
libB.dylib
libC.dylib
PlugIns/
PlugIn1.bundle/
...bundle contents
PlugIn2.bundle/
...bundle contents
PlugIn1.bundle 和 PlugIn2.bundle 都链接到 libA.dylib、libB.dylib 和 libC.dylib。这三个 dylib 的安装名称为 @loader_path/libName.dylib。但是,捆绑包找不到 libA.dylib、libB.dylib 或 libC.dylib。我尝试设置 -bundle_loader 标志来链接主可执行文件,但这没有帮助。捆绑包是否可以从 .app 包的 MacOS 文件夹中查找 dylib,而不必将它们也复制到捆绑包中?
My .app packages looks like this:
MyApp.app/
Contents/
MacOS/
MyApp
libA.dylib
libB.dylib
libC.dylib
PlugIns/
PlugIn1.bundle/
...bundle contents
PlugIn2.bundle/
...bundle contents
Both PlugIn1.bundle and PlugIn2.bundle are linked against libA.dylib, libB.dylib, and libC.dylib. The three dylibs have install names of @loader_path/libName.dylib. The bundles, however, cannot find libA.dylib, libB.dylib, or libC.dylib. I've tried setting the -bundle_loader flag to link against the main executable, but that didn't help. Is it possible for the bundles to look up the dylibs from the MacOS folder of the .app package and not have to copy them into the bundle as well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了使其正常工作,我必须将安装名称更改为@executable_path/libName.dylib
To get this working, I had to change the install name to @executable_path/libName.dylib