在静态库中添加了可达性

时间:2013-02-07 10:14:23

标签: ios objective-c xcode static-libraries reachability

我有我的静态库 在这个项目中,我添加了一个Reachability.h .m文件。 所以,我有一些链接器错误: 我还添加了CFNetwork和System.Configuration框架

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)

2 个答案:

答案 0 :(得分:1)

我已经解决了这个...... 我在使用我的静态库

的测试应用程序项目中添加了systemconfiguration.framework

答案 1 :(得分:0)

您必须确定您的Reachability.h .m已被编译。您需要转到“Build Phases”,然后转到“Compile SOurces”并添加Reachability.m来编译源代码。