IPhone development Unit Testing Linking Problem

iphoneunit testing

I've been trying to determine the cause of this error for days now. Tried doing simple projects by I could not get the unit tests to work? Does anyone know how to solve this problem?


Building target “ChildTests” of
project “Person” with configuration
“Debug” — (2 errors) Linking
/Users/me/Desktop/Person/build/Debug-iphonesimulator/ChildTests.octest/ChildTests(1
error) ".objc_class_name_Child",
referenced from:
literal-pointer@__OBJC@__cls_refs@Child
in ChildTests.o
symbol(s) not found
collect2: ld returned 1 exit status

 ...

Pardon me, I am new to iphone development.

Best Answer

The missing symbol is .objc_class_name_Child. I'm guessing you have a class called Child but its implementation file is not being built as part of your test target.

To fix the problem find the file (probably called Child.m) and make sure your test target is checked in the Targets tab of the file's File->Info.

Related Topic