What causes iOS linking errors?

2019-03-24 06:15发布

I've been getting some strange linking errors in XCode. I understand more or less what linking errors are, just not why they are showing up in my situation.

I have an app that started as iPhone only. When I adjusted it to be universal I got some odd linking errors. I then simply created a new universal project and imported the files, it built and executed without error. Now, working with the iPad interface, I've added some animations and am inheriting QuartzCore/QuartzCore.h but when I build, I get linking errors (shown below). What causes this sort of problem, how can I fix it, and how can I avoid it in the future?

"_OBJC_CLASS_$_CAMediaTimingFunction", referenced from:
objc-class-ref-to-CAMediaTimingFunction in mainViewController_iPad.o

"_OBJC_CLASS_$_CABasicAnimation", referenced from:
objc-class-ref-to-CABasicAnimation in mainViewController_iPad.o

"_kCAMediaTimingFunctionEaseIn", referenced from:
_kCAMediaTimingFunctionEaseIn$non_lazy_ptr in mainViewController_iPad.o
(maybe you meant: _kCAMediaTimingFunctionEaseIn$non_lazy_ptr)

"_OBJC_CLASS_$_CAKeyframeAnimation", referenced from:
objc-class-ref-to-CAKeyframeAnimation in mainViewController_iPad.o

"_OBJC_CLASS_$_CAAnimationGroup", referenced from:
objc-class-ref-to-CAAnimationGroup in mainViewController_iPad.o

"_CATransform3DIdentity", referenced from:
_CATransform3DIdentity$non_lazy_ptr in mainViewController_iPad.o
(maybe you meant: _CATransform3DIdentity$non_lazy_ptr)

ld: symbol(s) not found
collect2: ld returned 1 exit status

1条回答
姐就是有狂的资本
2楼-- · 2019-03-24 06:44

You need to add QuartzCore.framework.

查看更多
登录 后发表回答