Search code examples
iosobjective-cxcodestatic-librariesreachability

Reachability added in static library


I have my Static Library In this project i added a Reachability.h .m file. So, I have some linker errors: I added also the CFNetwork and System.Configuration framwork

Undefined symbols for architecture i386:
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[Reachability reachabilityWithAddress:] in libAdvertisingPromotions.a(Reachability.o)
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[Reachability reachabilityWithHostName:] in libAdvertisingPromotions.a(Reachability.o)
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[Reachability connectionRequired] in libAdvertisingPromotions.a(Reachability.o)
      -[Reachability currentReachabilityStatus] in libAdvertisingPromotions.a(Reachability.o)
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[Reachability startNotifier] in libAdvertisingPromotions.a(Reachability.o)
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[Reachability startNotifier] in libAdvertisingPromotions.a(Reachability.o)
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[Reachability stopNotifier] in libAdvertisingPromotions.a(Reachability.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution

  • I have solved this... I added systemconfiguration.framework in my test app project that uses my static library