什么原因导致iOS链接错误?

时间:2011-02-10 23:36:41

标签: ios frameworks linker

我在XCode中遇到了一些奇怪的链接错误。我或多或少地了解链接错误是什么,而不是它们出现在我的情况中的原因。

我的应用程序仅以iPhone启动。当我将其调整为通用时,我得到了一些奇怪的链接错误。然后我简单地创建了一个新的通用项目并导入了文件,它构建并执行时没有错误。现在,使用iPad界面,我添加了一些动画并继承了QuartzCore / QuartzCore.h但是当我构建时,我得到了链接错误(如下所示)。导致此类问题的原因是,我该如何修复它,以及如何在将来避免它?

"_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 个答案:

答案 0 :(得分:63)

您需要添加QuartzCore.framework