我一直收到此警告,任何人都可以帮助你解决错误?
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中运行正常,我无法理解,只是在构建到手机上时。
你需要链接到SystemConfiguration框架。在Xcode的项目导航器中选择你的项目,选择你的应用程序目标,然后选择“构建阶段”选项卡。在“使用库链接二进制文件”下,单击“ +”按钮,然后选择“ SystemConfiguration.framework”。
你可能还需要以相同的方式添加其他框架依赖项,但是添加SystemConfiguration可以解决我的相同错误。
ETA:我跳到错误的位置,在粘贴的顶部看不到ld警告。如果你已经链接到SystemConfiguration,请尝试删除并重新添加它,如果其他所有操作均失败,请更新Xcode。最新的发行版肯定具有正确的体系结构,因此在我看来,你的项目在错误的地方还是框架本身有问题。
你,我的朋友,摇滚。这花了30秒钟,立即为我解决了。谢谢。
谢谢你!你刚刚从一个漫长的下午中拯救了我:)
也为我工作。我认为这是正确的答案。
只是意识到我从来没有真正接受过这个作为正确答案。
叹。是2016年。为什么Xcode不能帮助我们解决此类问题,而不是喷出模糊的错误消息?昨天我注意到,apple.com / feedback网站使您可以提供有关所有Apple硬件和软件(除Xcode之外)的反馈。有趣的是...无论如何,谢谢-这完全解决了我的问题!