Reputation: 20140
I've tried to migrate our OCUnit
to XCTest
. So I have 100% compilable project but I see next linker error:
Error:Undefined symbol '_OBJC_CLASS_$_XCTestCase' referenced from:...
My "Framework Search Paths"
looks like this:
$(SDKROOT)/Developer/Library/Frameworks (non-recursive)
$(inherited) (non-recursive)
$(DEVELOPER_FRAMEWORKS_DIR) (non-recursive)
I'm not familiar what else to do to satisfy linker
Upvotes: 1
Views: 139
Reputation: 10127
I am seeing the exact same error messages in Xcode 6.1 after migrating with
Pull Down Menu → Edit → Refactor → Convert to XCTest.
I got 2 solutions:
Backup all source files in your test project.
In Project Navigator, select the project.
This shows the project settings.
In the project settings, click Show project and targets list.
Select the test target, and press delete to delete it.
In Project Navigator, select the test target, and press delete to delete it.
In Test Navigator, click the + button on the bottom left, and choose New Test Target.
Add your original source files back into the new test target.
Now test your project as usual.
In Project Navigator, select the project.
This shows the project settings.
In the project settings, select the test target (not the main target), then select Build Phases.
In Link Binary With Libraries, click the + button.
This shows the list of frameworks, but there is no XCTest.
Choose a framework that you don't use at all, say, Twitter.framework, and click Add.
Open your project file (something.pbxproj) in a text editor, and replace all occurrences of Twitter.framework with XCTest.framework.
Note: the pbxproj file is inside the .xcodeproj folder. In Finder, you have to right click on the .xcodeproj and select Show Package Contents.
Go back to Link Binary With Libraries in Xcode, and check that XCTest.framework is added.
Now test your project as usual.
Upvotes: 1