Warm tip: This article is reproduced from serverfault.com, please click

iphone-文件中缺少必需的体系结构armv7?

(iphone - missing required architecture armv7 in file?)

发布于 2012-04-27 09:08:38

我一直收到此警告,任何人都可以帮助你解决错误?

    ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms       /iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks//SystemConfiguration.framework/SystemConfiguration, missing required architecture armv7 in file
    Undefined symbols for architecture armv7:
    "_SCNetworkReachabilityCreateWithAddress", referenced from:
  +[Reachability reachabilityWithAddress:] in Reachability.o
   "_SCNetworkReachabilityCreateWithName", referenced from:
  +[Reachability reachabilityWithHostName:] in Reachability.o
   "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
  -[Reachability stopNotifier] in Reachability.o
   "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
  -[Reachability startNotifier] in Reachability.o
   "_SCNetworkReachabilitySetCallback", referenced from:
  -[Reachability startNotifier] in Reachability.o
   "_SCNetworkReachabilityGetFlags", referenced from:
  -[Reachability connectionRequired] in Reachability.o
  -[Reachability currentReachabilityStatus] in Reachability.o
   ld: symbol(s) not found for architecture armv7
   clang: error: linker command failed with exit code 1 (use -v to see invocation)

我的应用程序在Simulator中运行正常,我无法理解,只是在构建到手机上时。

Questioner
Popeye
Viewed
11
Siobhán 2012-05-23 10:01:30

你需要链接到SystemConfiguration框架。在Xcode的项目导航器中选择你的项目,选择你的应用程序目标,然后选择“构建阶段”选项卡。在“使用库链接二进制文件”下,单击“ +”按钮,然后选择“ SystemConfiguration.framework”。

你可能还需要以相同的方式添加其他框架依赖项,但是添加SystemConfiguration可以解决我的相同错误。

ETA:我跳到错误的位置,在粘贴的顶部看不到ld警告。如果你已经链接到SystemConfiguration,请尝试删除并重新添加它,如果其他所有操作均失败,请更新Xcode。最新的发行版肯定具有正确的体系结构,因此在我看来,你的项目在错误的地方还是框架本身有问题。