架构为armv7s的未定义符号:

6

我正在尝试将此功能添加到我的项目中:

https://github.com/mobitar/MBAlertView

当我尝试在我的应用程序中使用它时,出现以下错误:

Ld /Users/florianschaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Products/Debug-iphoneos/Janssenapp.app/Janssenapp normal armv7s cd /Users/florianschaal/Developer/Janssenapp setenv IPHONEOS_DEPLOYMENT_TARGET 6.1 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/florianschaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Products/Debug-iphoneos -L/Users/florianschaal/Developer/Janssenapp/Janssenapp/ZBarSDK -F/Users/florianschaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Products/Debug-iphoneos -filelist /Users/florianschaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Intermediates/Janssenapp.build/Debug-iphoneos/Janssenapp.build/Objects-normal/armv7s/Janssenapp.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.1 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/florianschaal/Library/Developer/Xcode/DerivedData/Janssenapp-egfiwitwudiuhubsglmuhxxuafya/Build/Products/Debug-iphoneos/Janssenapp.app/Janssenapp Undefined symbols for architecture armv7s: "_OBJC_CLASS_$_CABasicAnimation", referenced from: objc-class-ref in MBSpinningCircle.o "_kCAMediaTimingFunctionEaseOut", referenced from: -[MBAlertView animationWithValues:times:duration:] in MBAlertView.o "_kCATransitionFade", referenced from: -[UIView(Animations) addFadingAnimationWithDuration:] in UIView+Animations.o "_kCAMediaTimingFunctionEaseInEaseOut", referenced from: -[UIView(Animations) animationPop] in UIView+Animations.o -[UIView(Animations) addPulsingAnimation] in UIView+Animations.o -[UIView(Animations) addFadingAnimationWithDuration:] in UIView+Animations.o "_kCATransitionFromBottom", referenced from: -[UIView(Animations) addFadingAnimationWithDuration:] in UIView+Animations.o "_OBJC_CLASS_$_CATransition", referenced from: objc-class-ref in UIView+Animations.o "_kCAMediaTimingFunctionEaseIn", referenced from: -[MBAlertView addDismissAnimation] in MBAlertView.o "_kCAFillModeForwards", referenced from: -[UIView(Animations) animationPop] in UIView+Animations.o -[UIView(Animations) addPulsingAnimation] in UIView+Animations.o -[MBAlertView animationWithValues:times:duration:] in MBAlertView.o "_OBJC_CLASS_$_CAMediaTimingFunction", referenced from: objc-class-ref in UIView+Animations.o objc-class-ref in MBAlertView.o "_OBJC_CLASS_$_CAKeyframeAnimation", referenced from: objc-class-ref in UIView+Animations.o objc-class-ref in MBAlertView.o "_CATransform3DMakeScale", referenced from: -[UIView(Animations) animationPop] in UIView+Animations.o -[UIView(Animations) addPulsingAnimation] in UIView+Animations.o -[MBAlertView addDismissAnimation] in MBAlertView.o -[MBAlertView addBounceAnimationToLayer:] in MBAlertView.o -[MBAlertView didSelectBodyLabel:] in MBAlertView.o -[MBAlertView didHighlightButton:] in MBAlertView.o ld: symbol(s) not found for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation)

如果您不需要它,只需从该项目中删除演示文稿即可,这似乎是罪魁祸首。 - mrueg
3个回答

6

我已经下载了 MBAlertView 仓库,编译了示例项目并成功运行。之后,我将 MBAlertView 目录添加到我的项目中,并在项目文件的“Build Phases”中的“Link Binary With Librarys”部分中添加了 QuartzCore.framework,这样就可以正常工作了。


2
现在已添加QuartzCore.framework,所有错误都消失了。谢谢! - Florian Schaal

1

0

除非你正在编写高性能游戏并使用汇编语言,否则只需在构建设置中关闭armv7s架构。对于普通应用程序来说,这没有任何区别(它是iPhone5的处理器)。


构建设置:有效架构 - 只需删除armv7s。 - ahwulf
现在我遇到了这个错误:No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv7s, VALID_ARCHS=armv7)。那么我该如何设置armv7为活动架构? - Florian Schaal
如果有效的架构为armv7,则将“Build active architectures”设置为NO,它应该只构建armv7。同时确保架构设置也仅显示armv7。 - ahwulf

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接