Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone development Unit Testing Linking Problem

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.

like image 752
clyde Avatar asked Jan 23 '26 17:01

clyde


1 Answers

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.

like image 157
Will Harris Avatar answered Jan 26 '26 06:01

Will Harris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!