1

我正在尝试构建一个使用 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 的信息,我会得到“种类:Unix 可执行文件(PowerPC)”。这往往表明我为什么会遇到问题,因为我正在为架构 x86_64 构建英特尔平台。但是,我不明白它以前如何工作并停止工作......

谢谢你的帮助。

4

2 回答 2

1

您似乎已经构建了自己的 SenTestingKit 副本,并且它可能具有错误的体系结构。它位于 /Users/alexandrebeaulieu/workspaces/Project/build/Debug/SenTestingKit.framework。

当您使用共享构建位置时,Xcode 更喜欢使用您构建的任何框架来安装在系统上的框架。

于 2010-01-09T01:18:08.320 回答
0

我有同样的问题只是突然“看似”突然冒出来。但我发现解决方案只是进行清理和构建。

产品 > 清洁

于 2012-05-07T14:00:22.430 回答