胡克,

因此,我知道我将为此得到十几个“load the lib dummy”答案,但是这里...

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上get info时,它给了/Users/slate/Documents/osirix/osirix/Binaries/LibTiff/libtiff.dylib作为路径...而我选择了absolute path。那么为什么不在那里寻找呢?

呃...为什么要看@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)

最佳答案

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

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

10-12 06:21