Linking Error


#1

Hi,

I’m just trying to run the homepwner after implementing the section called “Creating and retrieving UITableViewCells” (Loc 5270 on the Kindle).

Although the program builds, when I run it I get a linking error and I was wondering if anyone had some clues about where to look for the problem or how to get more information about where my error is.
I’ve been trying to check if I have all my BNRItem vs BNRItemStore in line and before this it was working.


#2

I’ve been looking at this more and it appears that BNRItem.m is not being compiled even when I do a build clean. I’ve verified this by adding typos to the BNRItem.m file and a clean build is successful.

So now I’m curious how I tell the project to build the BNRItem.h and BNRItem.m files as part of the project. I have the line #include “BNRItem.h” at the top of ItemsViewController.m as well as BNRItemStore.h and the @class BNRItem; line at the top of BNRItemStore.h.


#3

Removing the files BNRItem.h and .m and readding them, making sure all the proper check boxes were checked solved the problem.

Sorry about the forum spam!


#4

I just had this issue as well.

This happens when you don’t add the files to the Homepwner target.

Instead of readding the file, you can also just click on BNRItem.m in Project Navigator, then click on the “File Inspector” on the right and check the box “Homepwner” in group “Target Membership.”


#5

Thank you htaccess!
You wrote a detailed reply. It solves the problem and I can understood it.


#6

Thanks htaccess!


#7

Thanks , had the same error, added files by dragging and not like I usually do with “add file to project”
:smiley:


#8

I had the same problem but I read the solution afterward I tried to solve it.

What I did is that I manually included into the building phase, actually I noticed BNRitem.m was not in the Compile Sources section of the Build Phases of the Target view of the Project. You just need to add with the +.

I don’t know if it is a valid way of solving the issue.

Any possible issues of doing it this way?