简体   繁体   English

体系结构armv7的未定义符号,ld:找不到体系结构armv7的符号-怎么办?

[英]Undefined symbols for architecture armv7, ld: symbol(s) not found for architecture armv7 - what to do?

I've read many posts on SO and none of the proposed solutions are working for me. 我已经阅读了很多关于SO的文章,但没有一个建议的解决方案对我有用。 I'm hoping someone who knows a little more about interpreting errors can help. 我希望对理解错误有更多了解的人可以提供帮助。

My app has been working fine (and still does), but I'm having an issue when using a certain class 'iCarousel' which is an implementation of Cover Flow. 我的应用程序运行良好(并且仍然可以正常运行),但是在使用某个类“ iCarousel”(这是Cover Flow的实现)时遇到问题。

Here's the interesting thing: When opening the sample project for the iCarousel, it runs fine on my iPhone. 这是有趣的事情:打开iCarousel的示例项目时,它在我的iPhone上运行良好。 My app (in a separate project) also runs fine. 我的应用程序(在单独的项目中)也运行良好。 They are both using armv6 armv7 architectures and running on iOS 5.1. 它们都使用armv6 armv7架构,并在iOS 5.1上运行。

I then copy the class to my own project and add all necessary frameworks. 然后,将类复制到我自己的项目中,并添加所有必要的框架。 There are no errors yet. 尚无错误。 But when I build and run I get an error: 但是,当我构建并运行时,出现错误:

Ld /Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-
ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Intermediates/TestApp.build/Debug-
iphoneos/TestApp.build/Objects-normal/armv7/TestApp normal armv7

    cd "/Users/Sooper/Developer/TestApp v1.0"
    setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
    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 armv7 -isysroot 

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
 -L/Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Products/
Debug-iphoneos -F/Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Products/
Debug-iphoneos -filelist /Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Intermediates/TestApp.build/
Debug-iphoneos/TestApp.build/Objects-normal/armv7/TestApp.LinkFileList -dead_strip -miphoneos-
version-min=5.0 -lz -framework QuartzCore -framework CoreGraphics -framework 
SystemConfiguration -lxml2.2.7.3 -framework Security -framework CoreMedia -framework Accounts 
-framework CoreFoundation -framework AudioToolbox -framework AVFoundation -framework Twitter -
framework MediaPlayer -framework UIKit -framework Foundation -o 
/Users/Sooper/Library/Developer/Xcode/DerivedData/TestApp-
ejfsezvwxyxhqpanwwrcmsbkslxi/Build/Intermediates/TestApp.build/Debug-
iphoneos/TestApp.build/Objects-normal/armv7/TestApp

Under this: 在此之下:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_ArtworkScrollerViewController", referenced from:
      objc-class-ref in TestAppViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If I remove the instance of the class the error goes away and the app runs. 如果我删除该类的实例,该错误将消失并且该应用程序将运行。 I'm totally confused. 我很困惑。 Why would it work separately but not in another project? 为什么要单独工作却不能在另一个项目中工作?

Would greatly appreciate some guidance. 将不胜感激一些指导。

确保您将ArtworkScrollerViewController.m添加到要构建的目标

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM