问题描述
Hoookay,
所以我知道我将得到一打"load the lib dummy"答案,但是这里...
So I know I'm about to get a dozen "load the lib dummy" answers to this, but here goes...
junk.framework正在导出另一个项目(junk.app)的某些对象,因此我可以在集群的remote.app节点上使用它.我可以编译junk.framework(通过动态加载,我意识到这已经毫无意义了),并且可以将remote.app编译并链接到junk.framework.
junk.framework is exporting some objects of another project (junk.app) so I can use it on a remote.app node on a cluster. I can compile junk.framework (which I realize means nothing anymore with dynamic loading) and compile and link remote.app to junk.framework.
但是,当我运行remote.app时,我得到了这个可爱的错误宝石:
However, when I run remote.app I get this lovely jewel of an error:
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是我正在研究的另一个项目(最终要构建).
I think what is going on is that junk.framework is loading libtiff.dylib from a certain location and it can't find it. junk.framework is another project I'm working on that I just got to build (finally).
当我在垃圾目标中的libtiff.dylib上使用get info
时,它给了我/Users/slate/Documents/osirix/osirix/Binaries/LibTiff/libtiff.dylib
作为路径...而我选择了absolute path
.那为什么不找它呢?
When I get info
on libtiff.dylib in my junk target it gives me /Users/slate/Documents/osirix/osirix/Binaries/LibTiff/libtiff.dylib
as a path... and I've got absolute path
selected. So why is it not looking there for it?
嗯...为什么要看@executable_path/../????该设置在哪儿,以便我可以更改?
Uh... why is it looking at @executable_path/../???? Where on earth is that setting so I can change it?
编辑---
otool -L给我这个:
otool -L gives me this:
/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)
推荐答案
在构建libtiff.dylib时指定了@executable_path设置. (如果您构建自己的dylib或框架,则它是安装目录(INSTALL_PATH)的构建设置.)可以使用install_name_tool命令对其进行更改.
The @executable_path setting was specified when libtiff.dylib was built. (If you build your own dylib or framework, it's the installation directory (INSTALL_PATH) build setting.) It can be changed with the install_name_tool command.
这篇关于Dyld:库未加载错误Mac OS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!