xcode 架构 armv6 的未定义符号,更新至 iOS 4.3
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5403575/
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
Undefined symbols for architecture armv6, Updating to iOS 4.3
提问by Ompah
I am patching upp an application from iOS 4.2 to 4.3 using new xcode4. With no changes made, except setting iOS to 4.3, I created entitlements and go!
我正在使用新的 xcode4 将应用程序从 iOS 4.2 修补到 4.3。除了将 iOS 设置为 4.3 之外,没有进行任何更改,我创建了权限并开始使用!
Message I get is:
我得到的消息是:
Undefined symbols for architecture armv6:"function", referenced from:
Ive tried to Clean the project, reinstalling xcode. I uninstalled also the xcode4 demo version. I also tried to set to Optimized armv7.
我试图清理项目,重新安装 xcode。我也卸载了 xcode4 演示版。我也尝试设置为优化的 armv7。
I would be very happy for some help, I'm stuck. Really.
我会很高兴得到一些帮助,我被困住了。真的。
Thanks very much in advance!
首先十分感谢!
回答by nevan king
Here's how I got this problem:
这是我遇到这个问题的方式:
I added a .h
, .m
and NIB from another project by dragging them onto my project navigator. Xcode didn't add them to the Build Phases properly.
我通过将另一个项目中的.h
,.m
和 NIB 拖到我的项目导航器中来添加它们。Xcode 没有正确地将它们添加到构建阶段。
My solution for this problem:
我对这个问题的解决方案:
- Click on the Project icon
- Go to the Target in the navigator menu
- Click on the "Build Phases" tab
- Add the
.m
file to "Compile Sources" (either drag it across, or use the + button) - Add the
.xib
or Storyboard file to "Copy bundle resources" - Clean and build
- 单击项目图标
- 转到导航器菜单中的目标
- 单击“构建阶段”选项卡
- 将
.m
文件添加到“编译源”(拖动它,或使用 + 按钮) - 将
.xib
或 Storyboard 文件添加到“复制捆绑资源” - 清洁和构建
回答by memmons
For this type of error, this is what I typically see:
对于这种类型的错误,这是我通常看到的:
Undefined symbols for architecture armv6:
"_OBJC_CLASS_$_MyCustomController", referenced from:
objc-class-ref in SomeOtherController.o
ld: symbol(s) not found for architecture armv6
Almost every time I see this error it is caused by hidden/invisible characters in the import statement in SomeOtherController.h
or SomeOtherController.m
. So, look at both your .h and .m file, find the line that looks like this:
几乎每次我看到此错误时,它都是由SomeOtherController.h
或中的导入语句中的隐藏/不可见字符引起的SomeOtherController.m
。因此,查看您的 .h 和 .m 文件,找到如下所示的行:
#import "MyCustomController.h"
Delete this line and retype it (do not copy/paste it -- you'll just repaste the offending hidden character).
删除这一行并重新输入(不要复制/粘贴它——你只会重新粘贴有问题的隐藏字符)。
回答by Derek Li
Click on your Project name in the navigation window, choose the target you're building against, go to build phases, make sure the one Xcode's telling you that's missing is in there.
在导航窗口中单击您的项目名称,选择您正在构建的目标,转到构建阶段,确保 Xcode 告诉您缺少的那个在那里。
回答by Barnabas Kecskes
I had the same problem in Xcode5 for iOS7 with the TestFlight SDK. My issue was that the 'Build Active Architecture Only' was set to Debug only.
我在带有 TestFlight SDK 的 iOS7 的 Xcode5 中遇到了同样的问题。我的问题是“仅构建活动架构”设置为仅调试。
You can find the setting under 'YourProject'->'Build Settings'->'Architectures'Set the 'Release' option to 'Yes'.
您可以在“YourProject”->“Build Settings”->“Architectures”下找到设置,将“Release”选项设置为“Yes”。
This solved my problem - I hope it helps you, too! :)
这解决了我的问题 - 我希望它也能帮助你!:)
回答by TALAA
I had the same problem in Xcode5 for iOS7 with the TestFlight SDK. My issue was that the 'Build Active Architecture Only' was set to Debug only.
我在带有 TestFlight SDK 的 iOS7 的 Xcode5 中遇到了同样的问题。我的问题是“仅构建活动架构”设置为仅调试。
You can find the setting under 'YourProject'->'Build Settings'->'Architectures' Set the 'Debug ' option to 'architecure arm7 arms7s'.
您可以在“YourProject”->“Build Settings”->“Architectures”下找到设置,将“Debug”选项设置为“architecure arm7 arm7s”。
This solved my problem - I hope it helps you, too! :)
这解决了我的问题 - 我希望它也能帮助你!:)
回答by David Tobiano
I had a similar issue popping-up all suddenly - more specifically, I was getting Undefined symbols for architecture armv6: "_OBJC_CLASS_$_CLLocationManager", referenced from: objc-class-ref in MyCLController.o
我突然出现了一个类似的问题 - 更具体地说,我得到了 Undefined symbols for architecture armv6: "_OBJC_CLASS_$_CLLocationManager", referenced from: objc-class-ref in MyCLController.o
Note that I had CoreLocation.framework listed in my frameworks (in xcode' Project left nav, under the Frameworks folder); and had previously geolocation working just fine.
请注意,我在我的框架中列出了 CoreLocation.framework(在 xcode 的 Project left nav 中,在 Frameworks 文件夹下);并且以前的地理定位工作得很好。
I got rid of the issue by re-installing CoreLocation.framework.
我通过重新安装 CoreLocation.framework 解决了这个问题。
If you're not sure how to do that in xcode:
* click on your project in xcode left nav bar
* Go in the General tab of your project settings
* Navigate down - you'll see the list of frameworks installed under Linked Frameworks and Libraries
* Click on the +
icon to add the CoreLocation.framework
如果您不确定如何在 xcode 中执行此操作:
* 在 xcode 左侧导航栏中单击您的项目
* 进入项目设置的常规选项卡
* 向下导航 - 您将看到安装的框架列表Linked Frameworks and Libraries
* 单击+
添加 CoreLocation.framework的图标
回答by Terry Bu
In my case, I was doing this in a viewcontroller.m
就我而言,我在 viewcontroller.m 中执行此操作
#import <MediaPlayer/MediaPlayer.h>
Without doing Link Binary With Libraries with MediaPlayer.framework. After adding it, it compiled fine
无需使用 MediaPlayer.framework 进行链接二进制与库。添加后,编译正常
回答by Senad Uka
I had this problem and I have just solved it. It was a simple typo in the function name (forgot one letter) that caused the problem in my case.
我有这个问题,我刚刚解决了它。在我的例子中,是函数名称中的一个简单的错字(忘记了一个字母)导致了这个问题。