iPhone Developer Tips Stats: Past 30 days - Pageviews: 88,766 Visitors: 61,679 Thank you everyone! Let's shoot for 100,000 by May. Pass it on...
|
In building a recent project I encountered an error during the linking process. I want to point out the error message and show you how this simple error can be resolved. The reason for pointing out this error is that I have no idea why this error came about…more on that in a moment.
Start by looking at the figure below:

The problem we have here is that the class SomeClass is referenced inside the file PrivateMethods implementation file (the .o extension represents the compiled object of the PrivateMethod class).
For some reason SomeClass is not included in the target, that is, SomeClass is not included in the list of object files that make up the final executable. Upon giving this error some thought, the obvious place to look is at the list of files that make up the target. We can do this by looking at the Details tab as shown below:

Notice that SomeClass.m is not included in the target (see the rightmost column). Simply clicking to add this file to the target, rebuilding, and all is well.
The reason for presenting this relatively trivial problem, and the change to correct this, is that I did not (intentionally) remove this file from the target. The point being, even if you never mess with target files and/or related build configuration, you still may need to visit these options if you receive linking errors.
Comments
10 Responses to “Linking Error: Symbol Not Found”
Leave Comment
Hi John,
Not sure if I’m dealing with a linking error also–but I’m finding when I attempt to override a subclass, say ViewDidLoad, once I have de-commented the template for the subclass, I cannot recomment it (and therefore revert to not overriding the subclass) without incurring an error when I try to run the iPhone simulator. Have you encountered this problem?
Any thoughts would be much appreciated!
John
John,
Can you provide a short snippet of code to show what you are working on?
Thanks
Thank you very much!!!
It was driving me crazy…
Another thing that might cause this is if you are running the app in the simulator and you’ve forgotten to add the Core Graphics framework to your project.
Thanks! I’ll try and re-attach some of the hair I pulled out now ;)
Great tip! Thank you for the post!
Thank you ~
Thanks.. good tip.
Thanks for posting this. Saved me a ton of effort.
Thanks for sharing this! Got it on the first Google.
:D