Xcode:找不到架构 armv7 的符号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12522571/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:33:12  来源:igfitidea点击:

Xcode: symbol(s) not found for architecture armv7

iosxcode

提问by DuckDucking

I have this message from Xcode

我收到来自 Xcode 的这条消息

Ld /Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp normal armv7
    cd /Users/myUsername/Documents/_IPAD/myApp
    setenv IPHONEOS_DEPLOYMENT_TARGET 4.3
    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/iPhoneOS6.0.sdk -L/Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Products/Debug-iphoneos -F/Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Products/Debug-iphoneos -filelist /Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=4.3 -framework AudioToolbox -framework SystemConfiguration -framework QuartzCore -framework OpenAL -framework CoreGraphics -framework CFNetwork -framework MessageUI -framework CoreData -framework AVFoundation -framework StoreKit -framework UIKit -framework Foundation -o /Users/myUsername/Library/Developer/Xcode/DerivedData/myApp-gqsubryokdmrjmczxeqypzcgpths/Build/Intermediates/myApp.build/Debug-iphoneos/myApp.build/Objects-normal/armv7/myApp



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

What exactly is not found? If it is saying that something was not found where is this not found stuff being looked for? Or in other words, if xcode is searching for something it is searching somewhere, where and what?

究竟是什么没有找到?如果它是说没有找到某些东西,那么在哪里寻找这个没有找到的东西?或者换句话说,如果 xcode 正在搜索某些东西,它正在搜索某处,在哪里搜索什么?

回答by Till

The ViewControllerobject is not found and it was referenced within AppDelegate. You do not link ViewController into your app. Check if your Compile Sourcessection within the Build Phasesof your project shows ViewController.m.

ViewController未找到该对象,并且在 中引用了该对象AppDelegate。您没有将 ViewController 链接到您的应用程序。检查您的项目中的Compile Sources部分是否Build Phases显示ViewController.m.

enter image description here

在此处输入图片说明

回答by nab

I just ran into this. Turns out I didn't add the new source to all of the targets that needed it. Maybe this will help someone in the future.. :)

我刚遇到这个。结果我没有将新源添加到所有需要它的目标中。也许这会在将来对某人有所帮助.. :)

回答by Ramis

I got same error after updating xCode 6beta to xCode 6.0.1. After spending a lot of time I fixed it by deleting "Derived Data" from Window -> Organizer -> Projects -> #Select project#and pressed Delete in the "Derived Data".

将 xCode 6beta 更新到 xCode 6.0.1 后,我遇到了同样的错误。花了很多时间后,我通过从窗口 -> 管理器 -> 项目 -> #Select project# 中删除“派生数据”来修复它,然后在“派生数据”中按下删除。