Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
551 views
in Technique[技术] by (71.8m points)

iphone - Undefined symbols for architecture armv7: "_SCNetworkReachabilityCreateWithAddress"

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)

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.

EDIT Forgot to add this bit.

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

EDIT

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Normally, extra slashes won't muck up a UNIX-like build process.

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/Sy??stemConfiguration

You should see output like this:

Architectures in the fat file: SystemConfiguration are: armv6 armv7

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/Lib??rary/Frameworks/SystemConfiguration.framework

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...