如何解决“dyld:库未加载:”问题Xcode 4 单元测试出错?
我有一个 Xcode 4 项目,一个带有 Spotlight、Core Data 和单元测试的 Cocoa 应用程序。该应用程序使用我编写的名为 TBPluginManager 的自定义框架来加载包。我最初在 Xcode 3 中编写了这个框架,但是当我在 Xcode 4 中使用它时,GDB 一直在抱怨,所以我在 Xcode 4 中重新创建了该框架。这让 GDB 很高兴,直到我尝试运行内置的单元测试并得到:
[切换到进程3840线程0x0] dyld:库未加载:>库/框架/TBPluginManager.framework/版本/A/TBPluginManager 引用自:/Users/elise/Library/Developer/Xcode/DerivedData/BookManager-cooglmktssmptpatjuetculukiqd/Build/Products/Release/BookManager.app/Contents/MacOS/BookManager
原因:找不到图片 共享库应用加载规则全部 现在没有可用于编程的内存:调用 malloc 不安全
现在我可以理解为什么单元测试找不到框架,因为它不在 Library/Frameworks/TBPluginManager.framework 中,而是在 /Library/Frameworks/TBPluginManager.framework 中。但是我如何将其告诉单元测试包呢?我尝试过设置框架、标题和库搜索路径构建设置,但无济于事。
顺便说一句,我已经回到 GHUnit 但我也想让它正常工作。
后续:尽管格雷迪·普莱尔(Grady Player)获得一个帐户只是为了告诉我我是个白痴,这让我很烦恼,但他或她可能是对的。我可爱、可靠的框架正在生成警告和错误,就像它们已经过时一样,因此我已将问题移交给 Apple 开发人员技术支持。如果有什么有趣的事情发生,我会把它发布在这里。否则我就删除这个问题。
I have an Xcode 4 project, a Cocoa application with Spotlight, Core Data and unit tests. The app uses a custom framework named TBPluginManager I wrote to load bundles. I originally wrote the framework in Xcode 3 but when I used it in Xcode 4 GDB kept complaining, so I recreated the framework in Xcode 4. This made GDB happy, until I tried to run the built-in unit-test and got:
[Switching to process 3840 thread 0x0]
dyld: Library not loaded: > Library/Frameworks/TBPluginManager.framework/Versions/A/TBPluginManager
Referenced from: /Users/elise/Library/Developer/Xcode/DerivedData/BookManager-cooglmktssmptpatjuetculukiqd/Build/Products/Release/BookManager.app/Contents/MacOS/BookManagerReason: image not found
sharedlibrary apply-load-rules all
No memory available to program now: unsafe to call malloc
Now I can understand why the unit test cannot find the framework since it lives not at Library/Frameworks/TBPluginManager.framework but at /Library/Frameworks/TBPluginManager.framework. But how do I tell that to the unit-test bundle? I've tried setting the Framework, Header and Library Search path build setting, but to no avail.
BTW, I've gone back to GHUnit but I'd like to get this working as well.
FOLLOW-UP: Much as it bugs me that Grady Player got an account just to tell me that I'm an idiot, it just may be that he or she is right. My lovely, dependable framework is generating warnings and errors like they're going out of fashion and so I've turned the problem over to Apple Developer Technical Support. If anything interesting comes out of it, I'll post it here. Otherwise, I'll delete the question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保安装在 /Library/Frameworks/TBPluginManager.framework 的框架有效并且与您尝试链接到的架构相同。如果您不确定再次重新编译框架,请将其放入自定义位置并在框架搜索路径中设置该自定义位置。
make sure that the framework installed at /Library/Frameworks/TBPluginManager.framework is valid and the same arch as you are trying to link it to. If you are in doubt recompile the framework again, put it in a custom location and set that custom location in your framework search path.