是的,这已经成为一个正确的痛苦我已经看了 2 天了,似乎无法解决它.这是我得到的错误.
Right this has become a right pain I have been looking at it for 2 days now and can't seem to solve it. Here is the error I am getting.
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)
我已经添加了 SystemConfiguration.framework,它似乎不想对它做任何事情,因为这个错误不会消失.我已经看过很多相同的问题,但其中很多确实证实了任何答案.这种是周末才发展起来的,没人碰过.谁能帮忙.
I have added SystemConfiguration.framework and it doesn't seem to want to do anything with it as this error just won't go away. I have looked at quite a few of the same problem but a lot of them done confirm any answers. This kind of just developed over the weekend when no one had touched it. Can anyone help.
编辑忘记加这个了.
ld:警告:忽略文件/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks//SystemConfiguration.framework/SystemConfiguration,缺失文件中所需的架构 armv7
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
编辑
好的,感谢@gaige,我发现了一个问题;在 SystemConfiguration.framework 之前有一个不应该存在的额外斜线.我已删除框架并重新添加,但没有帮助.如何删除这个多余的斜线?
Right Thanks to @gaige I have found a problem; there is an extra slash just before SystemConfiguration.framework that shouldn't be there. I have removed the framework and re-added and that has not helped. How can I remove this extra slash?
通常情况下,额外的斜线不会破坏类似 UNIX 的构建过程.
Normally, extra slashes won't muck up a UNIX-like build process.
但是,您确实需要确保 armv7 架构位于您的构建尝试使用的框架文件中.为此,请在命令行中使用 lipo -info
命令:
But, you do need to make sure the armv7 architecture is inside the framework file that your build is trying to use. To do this, use the lipo -info
command at the command line:
lipo -info /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks//SystemConfiguration.framework/SystemConfiguration
你应该看到这样的输出:
You should see output like this:
Architectures in the fat file: SystemConfiguration are: armv6 armv7
如果您不这样做,您的项目可能设置为链接到错误版本的 SystemConfiguration.framework.您的机器上有该框架的多个版本.因此,我将验证您在项目中拥有的框架(即 SystemConfiguration)的路径.
If you don't, your project is probably set up to link to the wrong version of the SystemConfiguration.framework. There's multiple versions of that framework on your machine. So, I would verify the path of the framework (i.e. SystemConfiguration) that you have in your project.
通常,我希望该文件是这样的(根据您使用的操作系统版本进行调整):
Normally, I would expect that file to be something like this (adjusted for the OS version you're using):
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/SystemConfiguration.framework
这篇关于架构 armv7 的未定义符号:“_SCNetworkReachabilityCreateWithAddress"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!