XCTest build errors for test target Xcode 5:

user798719 picture user798719 · Aug 16, 2013 · Viewed 24.3k times · Source

I have set up an XCode 5 iOS 7 project for unit tests.

Of course, setting up the unit tests are taking me so long that I'm trying to keep the faith that it's worth it. Struggling for hours over this error:

ld: building for iOS Simulator, but linking against dylib built for MacOSX file
'/Applications/Xcode5-DP5.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' 
for architecture i386

Any ideas on how to solve?

Answer

HatAndBeard picture HatAndBeard · Sep 21, 2013

Check your Framework Search Paths in your test target settings. These can be corrupted when adding the XCTest Framework.

Adding XCTest to one of my projects prepended a "/" to the paths causing them to not find the correct version.