Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode - linking error _OBJC_CLASS_$_"className" after replacing class files

Introduction

In a current project I'm working on we're using the ChartBoost SDK for popop commercials. We've been using this SDK for a while now with no problem whatsoever. It is a very simple library that essentially only has 1 header file called "ChartBoost.h" as well as a "libChartBoost.a" file.

Now we have just updated the SDK files with a new version. What I did here was simply removing the old SDK files from the project by "Move To Trash". What I did after was simply moving the new SDK files to the project, adding their references.

The problem

Right after doing this and compiling the project, I suddenly get 2 linking errors. Here's a screenshot of it:

Screenshot

I've tried pretty much everything I could think of to try and remove the error. I've cleaned the project and the project folder, and I've also tried to delete the derived data of the project through the organizer window.

I'm pretty certain this has something to do with the linker trying to use the references of the old files? But I'm not sure how I could go about getting it to remove those now-invalid references.

Is there anyone here who have any idea how this problem could be fixed?

[EDIT] Linking ChartBoost.a to the binary

So I tried linking the ChartBoost.a file to the binary through the "Build Phases" tab. This did get rid of the two original errors though revealed 8 new ones, shown in the screenshot below:

Linking errors 2

I'm not quite sure what these kind of linking errors are supposed to mean unfortunately :( Anyone got any ideas?

like image 482
CodingBeagle Avatar asked Mar 25 '12 19:03

CodingBeagle


1 Answers

In your app's target, look in "Build Phases", in the "Link Binary With Libraries" phase.

It should include libChartBoost.a.

If it doesn't, press the + button and select libChartBoost.a.

I'm pretty certain this has something to do with the linker trying to use the references of the old files?

No. You removed the old files from the project, and that included the reference in the "Link Binary With Libraries" build phase. When you added the new files to the project, you didn't add that reference back.

like image 107
Kurt Revis Avatar answered Nov 21 '22 05:11

Kurt Revis