更新到Xcode 6后:架构armv7的未定义符号:“___ gn_f2h_ieee”

时间:2014-07-03 19:26:30

标签: ios xcode compiler-errors cpu-architecture

我一直试图找到问题几个小时而没有结果。 我已经更新到Xcode 6并在ioS8.0和i上都出现了这个错误。 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)

感谢您的帮助。

编辑(完整构建日志错误):

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

2 个答案:

答案 0 :(得分:2)

我也遇到了一个非常类似的问题并发现了这一点。它解决了这个问题,非常有帮助。 http://helpdesk.metaio.com/questions/35905/undefined-symbols-for-architecture-i386-xcode-6-ios-8-beta-6/36538

创建.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);
}

答案 1 :(得分:1)

我无法解决问题,但我有部分解决方法 似乎许多浮点函数没有armv7切片。我假设它们将被包含在Xcode 6的后续版本中(或最终版本中)。

存在armv7s切片:因为我在使用后一个指令集的iPhone5上进行调试,所以我只需要从构建设置中删除该体系结构。

  1. 继续您的项目设置,选择您的项目。
  2. 构建设置下,查找架构条目。
  3. 对其进行修改,移除$(ARCHS_STANDARD)并将其替换为armv7s
  4. 正如jcr所说,您可能需要将Active Architecture Only选项从YES切换为NO
  5. 这将允许构建和运行。不幸的是,我没有要测试的arm64设备,但也可能包含此切片。