简体   繁体   English

在静态库中添加了可达性

[英]Reachability added in static library

I have my Static Library In this project i added a Reachability.h .m file. 我有我的静态库在这个项目中,我添加了Reachability.h .m文件。 So, I have some linker errors: I added also the CFNetwork and System.Configuration framwork 因此,我有一些链接器错误:我还添加了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)

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

You must be sure, that your Reachability.h .m gets compiled. 您必须确保已编译您的Reachability.h .m。 You need to go to your "Build Phases", then to "Compile SOurces" and add Reachability.m to compile sources. 您需要进入“构建阶段”,然后进入“ Compile SOurces”并添加Reachability.m来编译源代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM