库未加载到终端,但在 Xcode 上运行正常
我在 Xcode 中构建了一个命令行工具,它运行正常,但是当我尝试从终端运行它时,它抱怨我的一个库:
MacBook:Debug Jonathan$ ./MyApp
dyld: Library not loaded: /Users/Jonathan/Library/Frameworks/Josk.framework/Versions/A/Josk
Referenced from: /Users/Jonathan/Development/C++/MyApp/build/Debug/./MyApp
Reason: image not found
Trace/BPT trap
在我的 MyApp 项目上,我添加了一个复制阶段(目标:框架,没有路径,并且没有)将仅在安装时标记复选框)到目标,在 MyApp 的目录中我可以看到复制的 Josk.framework。
谢谢,
乔纳森
I built a command line tool within Xcode and it runs ok, but when I try to run it from the terminal it complains about one of my libs:
MacBook:Debug Jonathan$ ./MyApp
dyld: Library not loaded: /Users/Jonathan/Library/Frameworks/Josk.framework/Versions/A/Josk
Referenced from: /Users/Jonathan/Development/C++/MyApp/build/Debug/./MyApp
Reason: image not found
Trace/BPT trap
on my MyApp project I added a copy phase (destination: framework, no path and didn't mark the only-on-installing checkbox) to the target and on the directory of MyApp I can see the Josk.framework copied.
Thanks,
Jonathan
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
导出 DYLD_FRAMEWORK_PATH=/Users/Jonathan/Library/Frameworks
或
将 Josk.framework 复制到 /Users/Jonathan/Library/Frameworks
对于部署,有各种选项,例如 @executable_path、@loader_path、@rpath。
瞧,迪尔德
export DYLD_FRAMEWORK_PATH=/Users/Jonathan/Library/Frameworks
or
copy Josk.framework to /Users/Jonathan/Library/Frameworks
For deployment, there are various options such as @executable_path, @loader_path, @rpath.
see, man dyld