1

我有我的静态库 在这个项目中,我添加了一个 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)
4

2 回答 2

1

我已经解决了这个问题...我在使用我的静态库的测试应用程序项目中添加了 systemconfiguration.framework

于 2013-02-07T10:35:19.100 回答
0

您必须确定您的 Reachability.h .m 已被编译。您需要进入“构建阶段”,然后进入“编译源”并添加 Reachability.m 以编译源。

于 2013-02-07T10:24:51.607 回答