更新到 Xcode 6 后:架构 armv7 的未定义符号:“___gnu_f2h_ieee”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24561863/
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
After update to Xcode 6 : Undefined symbols for architecture armv7: "___gnu_f2h_ieee"
提问by jcr
I have been trying to find the problem for hours with no result. I have updated to Xcode 6 and get this error on both ioS8.0 & 7.1 since then :
我一直试图找到问题几个小时但没有结果。我已更新到 Xcode 6 并从那时起在 ioS8.0 和 7.1 上都出现此错误:
Undefined symbols for architecture armv7:
"___gnu_f2h_ieee", referenced from:
_playbackCallback in Audio.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks for your help.
谢谢你的帮助。
EDIT (full build log error) :
编辑(完整构建日志错误):
Ld /Users/rjc/Library/Developer/Xcode/DerivedData/Acc-hjhfomxkmwbyxwbfzjbduabbhlcc/Build/Products/Debug-iphoneos/Acc.app/Acc normal armv7
cd /Users/rjc/Desktop/apps/Acc
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Applications/Xcode6-Beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode6-Beta2.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode6-Beta2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode6-Beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -L/Users/rjc/Library/Developer/Xcode/DerivedData/Acc-hjhfomxkmwbyxwbfzjbduabbhlcc/Build/Products/Debug-iphoneos -L/Users/rjc/Desktop/apps/Acc/Acc -F/Users/rjc/Library/Developer/Xcode/DerivedData/Acc-hjhfomxkmwbyxwbfzjbduabbhlcc/Build/Products/Debug-iphoneos -F/Users/rjc/Desktop/apps/Acc -filelist /Users/rjc/Library/Developer/Xcode/DerivedData/Acc-hjhfomxkmwbyxwbfzjbduabbhlcc/Build/Intermediates/Acc.build/Debug-iphoneos/Acc.build/Objects-normal/armv7/Acc.LinkFileList -dead_strip -ObjC -all_load -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.1 -lCorePlot-CocoaTouch -framework CoreTelephony -framework MediaPlayer -framework MessageUI -framework Social -framework Accelerate -framework CoreLocation -framework MobileCoreServices -framework AVFoundation -framework AudioToolbox -framework CoreAudio -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -Xlinker -dependency_info -Xlinker /Users/rjc/Library/Developer/Xcode/DerivedData/Acc-hjhfomxkmwbyxwbfzjbduabbhlcc/Build/Intermediates/Acc.build/Debug-iphoneos/Acc.build/Objects-normal/armv7/Acc_dependency_info.dat -o /Users/rjc/Library/Developer/Xcode/DerivedData/Acc-hjhfomxkmwbyxwbfzjbduabbhlcc/Build/Products/Debug-iphoneos/Acc.app/Acc
回答by Charitha Basnayake
I also faced a very similar issue and found this. It was resolved the issue and was very helpful. http://helpdesk.metaio.com/questions/35905/undefined-symbols-for-architecture-i386-xcode-6-ios-8-beta-6/36538
我也遇到了一个非常相似的问题,并发现了这一点。它解决了这个问题,非常有帮助。 http://helpdesk.metaio.com/questions/35905/undefined-symbols-for-architecture-i386-xcode-6-ios-8-beta-6/36538
Make a .c file (name is not a concern, in my case i made i386Symbols.c) and add it to the project. Then paste this.
制作一个 .c 文件(名称不是问题,在我的例子中我制作了 i386Symbols.c)并将其添加到项目中。然后粘贴这个。
// i386Symbols.c
// Your project
//
// Created by Ludwig on 10/2/14.
// Copyright (c) 2014. All rights reserved.
//
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
FILE *fopen$UNIX2003( const char *filename, const char *mode )
{
return fopen(filename, mode);
}
int fputs$UNIX2003(const char *res1, FILE *res2){
return fputs(res1,res2);
}
int nanosleep$UNIX2003(int val){
return usleep(val);
}
char* strerror$UNIX2003(int errornum){
return strerror(errornum);
}
double strtod$UNIX2003(const char *nptr, char **endptr){
return strtod(nptr, endptr);
}
size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d )
{
return fwrite(a, b, c, d);
}
回答by Spak
I couldn't resolve the issue, but I have a partial workaround.
It seems that there is no armv7
slice for many floating point functions. I assume that they will be included in a later release (or in the final release) of Xcode 6.
我无法解决该问题,但我有部分解决方法。许多浮点函数
似乎没有armv7
切片。我假设它们将包含在 Xcode 6 的后续版本(或最终版本)中。
The armv7s
slice is present instead: since I was debugging on an iPhone5, that uses this latter instruction set, I had just to remove the architecture from the build settings.
该armv7s
切片存在,而不是:因为我上的iPhone5的调试,使用后者的指令集,我刚刚从构建设置中删除架构。
- Go on your project settings, select your project.
- Under Build Settings, look for the Architecturesentry.
- Edit it, remove
$(ARCHS_STANDARD)
and replace it witharmv7s
. - As jcr noted, you may have to switch the
Active Architecture Only
option fromYES
toNO
.
- 继续您的项目设置,选择您的项目。
- 在Build Settings 下,查找Architectures条目。
- 编辑它,删除
$(ARCHS_STANDARD)
并替换为armv7s
. - 正如 jcr 所指出的,您可能需要将
Active Architecture Only
选项从切换YES
到NO
。
This will allow to build and run. Unfortunately I have no arm64
device to test, but it might be possible that this slice is also included.
这将允许构建和运行。不幸的是,我没有arm64
要测试的设备,但也可能包含此切片。