Alexandre Beaulieu
Alexandre Beaulieu

Reputation: 392

OCUnit (SenTestingKit) error file is not of required architecture

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.

Upvotes: 1

Views: 2320

Answers (2)

James Dunay
James Dunay

Reputation: 2724

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

Upvotes: 0

ken
ken

Reputation: 76

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.

Upvotes: 1

Related Questions