OCUnit (SenTestingKit) 错误文件不符合所需架构
我正在尝试构建一个使用 OCUnit 运行测试的项目,但在链接时出现以下错误:
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks//SenTestingKit.framework/SenTestingKit, file is not of required architecture
Undefined symbols:
"_STComposeString", referenced from:
-[ReaderTest testEmptyFile] in ReaderTest.o
-[ReaderTest testReadOneLine] in ReaderTest.o
-[ReaderTest testReadOneLine] in ReaderTest.o
"_OBJC_CLASS_$_SenTestCase", referenced from:
_OBJC_CLASS_$_ReaderTest in ReaderTest.o
_OBJC_CLASS_$_ActionUserInfoReaderTest in ActionUserInfoReaderTest.o
"_OBJC_METACLASS_$_SenTestCase", referenced from:
_OBJC_METACLASS_$_ReaderTest in ReaderTest.o
_OBJC_METACLASS_$_ActionUserInfoReaderTest in ActionUserInfoReaderTest.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
我之前能够使用 OCUnit 构建和运行,没有任何问题。这个问题本周出现,但我不知道是什么变化的结果。我尝试使用 iPhone SDK 3.2.1 重新安装 XCode,但没有成功。
如果我确实获取了 /Library/Frameworks/SenTestingKit.framework/Versions/A/SenTestingKit 上的信息,我会得到“Kind: Unix Executable File (PowerPC)”。这往往表明为什么我会遇到问题,因为我是在 x86_64 架构的 Intel 平台上构建的。但是,我不明白它以前如何工作并停止工作......
感谢您的帮助。
I'm trying to build a project that uses OCUnit to run tests but get the following errors when linking:
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks//SenTestingKit.framework/SenTestingKit, file is not of required architecture
Undefined symbols:
"_STComposeString", referenced from:
-[ReaderTest testEmptyFile] in ReaderTest.o
-[ReaderTest testReadOneLine] in ReaderTest.o
-[ReaderTest testReadOneLine] in ReaderTest.o
"_OBJC_CLASS_$_SenTestCase", referenced from:
_OBJC_CLASS_$_ReaderTest in ReaderTest.o
_OBJC_CLASS_$_ActionUserInfoReaderTest in ActionUserInfoReaderTest.o
"_OBJC_METACLASS_$_SenTestCase", referenced from:
_OBJC_METACLASS_$_ReaderTest in ReaderTest.o
_OBJC_METACLASS_$_ActionUserInfoReaderTest in ActionUserInfoReaderTest.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I was able to build and run with OCUnit without any problem before. This problem appeared this week but I can't tell as result of what change. I tried reinstalling XCode with the iPhone SDK 3.2.1 to no avail.
If I do get info on /Library/Frameworks/SenTestingKit.framework/Versions/A/SenTestingKit, I get "Kind: Unix Executable File (PowerPC)". This tends to indicate why I'm having a problem since I'm building on an Intel platform for architecture x86_64. However, I don't understand how it could have worked before and stopped working...
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您似乎已经构建了自己的 SenTestingKit 副本,并且可能它的架构错误。它位于 /Users/alexandrebeaulieu/workspaces/Project/build/Debug/SenTestingKit.framework。
当您使用共享构建位置时,Xcode 更喜欢使用您构建的任何框架而不是系统上安装的框架。
You seem to have built your own copy of SenTestingKit, and perhaps it has the wrong architectures. It's at /Users/alexandrebeaulieu/workspaces/Project/build/Debug/SenTestingKit.framework.
When you use a shared build location, Xcode prefers to use any framework you've built to one that is installed on the system.
我也遇到了同样的问题,只是“似乎”突然出现。但我发现解决方案就是进行清理并构建。
产品>干净的
I had the same problem just spring 'seemingly' out of nowhere. But I found the solution to be just do a clean and build.
Product > Clean