gpt4 book ai didi

xcode - 插件包中的 dylib @executable_path 路径问题

转载 作者:行者123 更新时间:2023-12-04 00:51:18 33 4
gpt4 key购买 nike

我正在开发 插件包 ,说 MyPlugIn.bundle 申请 ,说 BigApp.app . 这个包需要一个 dylib ,说 MyPlugIn.bundle/Contents/Resources/library.dylib .我已经为 library.dylib 重新定位了路径,就像我对一个简单的应用程序包所做的那样:

$ otool -L MyPlugIn.bundle/Contents/MacOS/MyPlugIn
MyPlugIn.bundle/Contents/MacOS/MyPlugIn:
@executable_path/../Resources/library.dylib (compatibility version 0.0.0, current version 0.0.0)
[...]

$ otool -L MyPlugIn.bundle/Contents/Resources/library.dylib
MyPlugIn.bundle/Contents/Resources/library.dylib:
@executable_path/../Resources/library.dylib (compatibility version 0.0.0, current version 0.0.0)
[...]

但是 BigApp.app 无法加载此包,Mac OS X 的 Console.app 记录以下内容:
19/01/10 15:42:59 BigApp[51516] Error loading /Library/Application Support/BigApp/Plug-Ins/MyPlugIn.bundle/Contents/MacOS/MyPlugIn:  dlopen(/Library/Application Support/BigApp/Plug-Ins/MyPlugIn.bundle/Contents/MacOS/MyPlugIn, 262): Library not loaded: @executable_path/../Resources/library.dylib
Referenced from: /Library/Application Support/BigApp/Plug-Ins/MyPlugIn.bundle/Contents/MacOS/MyPlugIn
Reason: image not found

似乎@executable_path 没有被 MyPlugIn.bundle 可执行路径替换,而是被 BigApp.app 可执行路径 .

任意 解决方法 到那个,没有绝对路径,所以它会在 上工作Mac OS X 10.4 (Tiger) ?谢谢。

最佳答案

关于xcode - 插件包中的 dylib @executable_path 路径问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2094411/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com