Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,694
6,269
I'm using Reachability.h/m in my project to determine whether or not the user has a network connection.

It was initially complaining about ARC, so I turned off ARC for the file, and that got rid of about half the errors, but it's still giving me errors about

"Apple Mach-O Linker (Id) Error"

Code:
Undefined symbols for architecture i386:
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[Reachability startNotifier] in Reachability.o
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[Reachability startNotifier] in Reachability.o
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[Reachability stopNotifier] in Reachability.o
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[Reachability reachabilityWithHostName:] in Reachability.o
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[Reachability reachabilityWithAddress:] in Reachability.o
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[Reachability connectionRequired] in Reachability.o
      -[Reachability currentReachabilityStatus] 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)

Any suggestions?
 
Oh!

Thank you! I copied and pasted reachability from one project to another but forgot to make sure all the frameworks were there. Thanks!
 
I'm using Reachability.h/m in my project to determine whether or not the user has a network connection.

Are you using Reachability only to determine if a network connection exists?

Try connecting to the network and downloading whatever resource your application is interested in. The NSURLConnection APIs will give you an error if the connection fails. That error will tell you if there was no network connection.

This is going to be more efficient than using Reachability in your application. Reachability is useful some of the time. It is not a good idea if your only goal is to find out if a connection exists.
 
Are you using Reachability only to determine if a network connection exists?

Try connecting to the network and downloading whatever resource your application is interested in. The NSURLConnection APIs will give you an error if the connection fails. That error will tell you if there was no network connection.

This is going to be more efficient than using Reachability in your application. Reachability is useful some of the time. It is not a good idea if your only goal is to find out if a connection exists.

I'm using it before sending a request to Apple's servers information on items available for In-App Purchase... if I simply sent it and didn't get a response, that wouldn't say whether the issue was a lack of a connection or a failure elsewhere.
 
Actually, the recommended strategy is to attempt to send the request. If it fails then check reachability. If the answer is "not reachable" then present that error to the user. Otherwise present the error that you received from your attempted request to the user.
 
Actually, the recommended strategy is to attempt to send the request. If it fails then check reachability. If the answer is "not reachable" then present that error to the user. Otherwise present the error that you received from your attempted request to the user.

I guess that makes sense.

I have a bigger issue though right now... my code is still not compiling and is still giving me the same errors as before. "SystemConfiguration.framework" has been added to my list of Frameworks, I've cleaned, restarted Xcode, and attempted to run, but got the same exact errors. Suggestions?

I'm noticing a warning
Ignoring file [...]SystemConfiguration.framework/SystemConfiguration, missing required architecture i386 in file

Edit: Alright, I've got it working now.

The issue was the method I'd used to add the framework. The proper way of doing it was to go to the target, click on the build phases tab, and then add it to the list labeled "Link Binary With Libraries" (using the + button in the bottom corner.)
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.