我一直在与Xcode战斗两天,现在试图建立一个dylib,然后通过可执行文件加载,并且持续存在dyld: Library not loaded:
错误。
我现在处于一个目录中的可执行文件(/Users/drew/Development/Tools/bin
- 我的个人bin目录)和另一个目录中的dylib(/Users/drew/Development/lib
- 我的个人lib目录)。
该应用程序是一个命令行应用程序,它的otool -L输出如下所示
otool -L configcompiler
configcompiler:
"/Users/drew/Development/lib/WSWebScraper dylib.dylib" (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.8.0)
/System/Library/Frameworks/CoreData.framework/Versions/A/CoreData (compatibility version 1.0.0, current version 407.5.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 945.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.0.0)
dylib文件肯定存在于'lib'位置
ls -l "/Users/drew/Development/lib/WSWebScraper dylib.dylib"
-rwxr-xr-x 1 drew staff 246996 20 Aug 11:43 /Users/drew/Development/lib/WSWebScraper dylib.dylib
...但应用程序报告错误如下。
./configcompiler
dyld: Library not loaded: "/Users/drew/Development/lib/WSWebScraper dylib.dylib"
Referenced from: /Users/drew/Development/Tools/bin/./configcompiler
Reason: image not found
Trace/BPT trap: 5
我已经盯着这个太长时间了,可能无法发现明显的 - 另一双眼睛可能会发现错误。感谢您提供的任何帮助。
安德鲁