Ved
Ved

Reputation: 2701

Reachability class error

Xcode 4.2, iOS 5.0 My project is ARC enabled, When add non-ARC Reachabilty class in my project, then I got following error:

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)

Upvotes: 2

Views: 304

Answers (2)

Niko
Niko

Reputation: 2543

Did you add the framework SystemConfiguration.framework in your project??

Upvotes: 1

Michael Dautermann
Michael Dautermann

Reputation: 89509

The library you added in appears to be only built for the device and not for the simulator (which is why it's saying "not found for architecture i386").

Find the code and add it to your project directly and you should be able to build for both the device and the simulator.

Upvotes: 1

Related Questions