Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

exmorpheus

macrumors newbie
Original poster
Mar 19, 2011
4
0
I want to animate some images and have this line:

Code:
CADisplayLink *foo = [CADisplayLink displayLinkWithTarget:self selector:
                                    @selector(fooMethod)];

and I get this error message.

Code:
".objc_class_name_CADisplayLink", referenced from:
   literal-pointer@__OBJC@__cls_refs@CADisplayLink in fooClass.o
   symbol(s) not found
   collect2: ld returned 1 exit status

I can only view this error in the build results and doesn't appear in the code window next to the code. So what gives?
 
Last edited:
Have you included whatever framework CADisplayLink is declared in? In particular have you added it to your project? I suspect not as the error you are getting is from the linker indicating that it can't find the compiled code for that class in the frameworks it's linking with.
 
yeah, I use the

Code:
#import <QuartzCore/QuartzCore.h>

before my code. Without it, I get a different error saying it can't find the declaration of CADisplayLink right there in the code next to the line.
 
yeah, I use the

Code:
#import <QuartzCore/QuartzCore.h>

before my code. Without it, I get a different error saying it can't find the declaration of CADisplayLink right there in the code next to the line.

That's not what robbieduncan was asking. It doesn't tell the linker where to find the object code for the framework.

You need to add the framework to the project:

To include a framework in your Xcode project, choose Project > Add to Project and select the framework directory. Alternatively, you can control-click your project group and choose Add Files > Existing Frameworks from the contextual menu. When you add an existing framework to your project, Xcode asks you to associate it with one or more targets in your project. Once associated, Xcode automatically links the framework against the resulting executable.

http://developer.apple.com/library/...ks.html#//apple_ref/doc/uid/20002257-BAJJBBHJ

B
 
Yep, that was it. Thanks. I thought that framework was a part of XCode and there was no importing necessary. But now I learned a thing or two about frameworks from this, thanks for the Apple link.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.