What causes iOS linking errors?

百般思念 提交于 2020-01-01 04:02:08

问题


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:


You need to add QuartzCore.framework.



来源:https://stackoverflow.com/questions/4963980/what-causes-ios-linking-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!