Possible duplicate:
Undefined symbols for armv7 architecture: "_SCNetworkReachabilityCreateWithAddress"
I tried a couple of things that I found here and no one worked. I have added Apple .h and .m reachability files to my project. I am trying to check the availability of the mogul server, and the following code that I used in my real program:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNetworkChange:) name:kReachabilityChangedNotification object:nil]; reach = [Reachability reachabilityForInternetConnection]; [reach startNotifier]; NetworkStatus remoteHostStatus = [reach currentReachabilityStatus]; if (remoteHostStatus == NotReachable) { NSLog(@"no"); textTest.text = @"Can't reach it"; } else if(remoteHostStatus == ReachableViaWiFi || remoteHostStatus == ReachableViaWWAN){ NSLog(@"Yes"); textTest.text = @"Got it"; } testServer.hidden = YES; .... -(void)handleNetworkChange:(NSNotification *)notice{ NetworkStatus remoteHostStatus = [reach currentReachabilityStatus]; if (remoteHostStatus == NotReachable) { NSLog(@"no"); textTest.text = @"Can't get it"; } else if(remoteHostStatus == ReachableViaWiFi || remoteHostStatus == ReachableViaWWAN){ NSLog(@"Got it"); textTest.text = @"Got it"; } }
and in the .h file:
@property (retain, nonatomic) Reachability *reach; .... -(void)handleNetworkChange:(NSNotification *)notice;
Every time I try to compile and run, this is what I get:
Ld /Users/ConorMccallion/Library/Developer/Xcode/DerivedData/newClient-aunayptutxnlhjeoflldefcmybpk/Build/Products/Debug-iphonesimulator/newClient.app/newClient normal i386 cd /Volumes/TRAVELDRIVE/Reseaech/ClientSide/newClient setenv IPHONEOS_DEPLOYMENT_TARGET 6.0 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/ConorMccallion/Library/Developer/Xcode/DerivedData/newClient-aunayptutxnlhjeoflldefcmybpk/Build/Products/Debug-iphonesimulator -F/Users/ConorMccallion/Library/Developer/Xcode/DerivedData/newClient-aunayptutxnlhjeoflldefcmybpk/Build/Products/Debug-iphonesimulator -filelist /Users/ConorMccallion/Library/Developer/Xcode/DerivedData/newClient-aunayptutxnlhjeoflldefcmybpk/Build/Intermediates/newClient.build/Debug-iphonesimulator/newClient.build/Objects-normal/i386/newClient.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/ConorMccallion/Library/Developer/Xcode/DerivedData/newClient-aunayptutxnlhjeoflldefcmybpk/Build/Products/Debug-iphonesimulator/newClient.app/newClient Undefined symbols for architecture i386: "_SCNetworkReachabilityCreateWithAddress", referenced from: +[Reachability reachabilityWithAddress:] in ViewController.o +[Reachability reachabilityWithAddress:] in Reachability.o "_SCNetworkReachabilityCreateWithName", referenced from: +[Reachability reachabilityWithHostName:] in ViewController.o +[Reachability reachabilityWithHostName:] in Reachability.o "_SCNetworkReachabilityGetFlags", referenced from: -[Reachability connectionRequired] in ViewController.o -[Reachability currentReachabilityStatus] in ViewController.o -[Reachability connectionRequired] in Reachability.o -[Reachability currentReachabilityStatus] in Reachability.o "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: -[Reachability startNotifier] in ViewController.o -[Reachability startNotifier] in Reachability.o "_SCNetworkReachabilitySetCallback", referenced from: -[Reachability startNotifier] in ViewController.o -[Reachability startNotifier] in Reachability.o "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: -[Reachability stopNotifier] in ViewController.o -[Reachability stopNotifier] in Reachability.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is probably something obvious, so the answer would be greatly appreciated. thank you
source share