架构armv7的未定义符号,ld:未找到用于架构armv7的符号 - 该怎么办? [英] Undefined symbols for architecture armv7, ld: symbol(s) not found for architecture armv7 - what to do?

查看:407
本文介绍了架构armv7的未定义符号,ld:未找到用于架构armv7的符号 - 该怎么办?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了很多SO的帖子,没有一个建议的解决方案是为我工作。我希望有人了解更多关于解释错误的信息。



我的应用程序一直工作正常(但仍然存在),但我遇到了问题当使用某个类'iCarousel',它是Cover Flow的实现。



这里有趣的事情:当打开iCarousel的示例项目时,苹果手机。我的应用程序(在一个单独的项目)也运行良好。他们都使用 armv6 armv7 架构并在iOS 5.1上运行。



然后将类复制到我自己的项目并添加所有必要的框架。没有错误。但是当我构建和运行我得到一个错误:

  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/ /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安全 - 框架CoreMedia -framework帐户
-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
/ pre>

在此之下:

 未定义的架构符号armv7: 
_OBJC_CLASS _ $ _ ArtworkScrollerViewController,引用自:
objc-class-ref in TestAppViewController.o
ld:未找到用于体系结构的符号armv7
clang:error:linker命令失败,退出代码1(使用-v查看调用)

类错误消失,应用程序运行。我完全困惑。



非常感谢一些指导。

解决方案

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


I've read many posts on SO and none of the proposed solutions are working for me. 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.

Here's the interesting thing: When opening the sample project for the iCarousel, it runs fine on my iPhone. My app (in a separate project) also runs fine. They are both using armv6 armv7 architectures and running on 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.

解决方案

make sure you add ArtworkScrollerViewController.m to the target that you are building

这篇关于架构armv7的未定义符号,ld:未找到用于架构armv7的符号 - 该怎么办?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆