gpt4 book ai didi

objective-c - Dyld:库未加载错误 Mac OS

转载 作者:太空狗 更新时间:2023-10-30 03:49:49 25 4
gpt4 key购买 nike

胡凯,

所以我知道我将得到一打“加载 lib 虚拟”答案,但是这里......

junk.framework 正在导出另一个项目 (junk.app) 的一些对象,因此我可以在集群上的 remote.app 节点上使用它。我可以编译 junk.framework(我意识到这对动态加载不再有任何意义)并编译 remote.app 并将其链接到 junk.framework。

但是,当我运行 remote.app 时,我得到了这个可爱的错误:

dyld: Library not loaded: @executable_path/../Frameworks/libtiff.dylib
Referenced from: /Users/slate/Documents/junk/build/Development/junk.framework/Versions/A/junk
Reason: image not found

我认为发生的事情是 junk.framework 正在从某个位置加载 libtiff.dylib,但找不到它。 junk.framework 是我正在处理的另一个项目,我刚刚(终于)构建了它。

当我在垃圾目标中获取有关 libtiff.dylib 的信息时,它会给我 /Users/slate/Documents/osirix/osirix/Binaries/LibTiff/libtiff.dylib作为路径...并且我选择了绝对路径。那么为什么它不在那里寻找呢?

呃...为什么它在看@executable_path/../????该设置到底在哪里,以便我可以更改它?

编辑---

otool -L 给我这个:

/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.26.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 949.54.0)
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 12.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
@executable_path/../Frameworks/libtiff.dylib (compatibility version 11.0.0, current version 11.4.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
/System/Library/Frameworks/QTKit.framework/Versions/A/QTKit (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime (compatibility version 1.0.0, current version 1327.73.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 32.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.19.0)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 34.0.0)
/System/Library/Frameworks/vecLib.framework/Versions/A/vecLib (compatibility version 1.0.0, current version 242.0.0)

最佳答案

@executable_path 设置是在构建 libtiff.dylib 时指定的。 (如果您构建自己的 dylib 或框架,它是安装目录 (INSTALL_PATH) build设置。)它可以使用 install_name_tool 命令更改。

关于objective-c - Dyld:库未加载错误 Mac OS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2975008/

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