3

将我的 Xcode 项目从在 Xcode 4.2 上运行的 Mac 移动到另一台运行 Xcode 4.5 的 Mac 后,我收到以下错误。

 "_SCError", referenced from:
      -[RKReachabilityObserver scheduleObserver] in libRestKit.a(RKReachabilityObserver.o)
      -[RKReachabilityObserver unscheduleObserver] in libRestKit.a(RKReachabilityObserver.o)
  "_SCErrorString", referenced from:
      -[RKReachabilityObserver scheduleObserver] in libRestKit.a(RKReachabilityObserver.o)
      -[RKReachabilityObserver unscheduleObserver] in libRestKit.a(RKReachabilityObserver.o)
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[Reachability reachabilityWithAddress:] in Reachability.o
      +[Reachability reachabilityWithAddress:] in test1ViewController.o
      -[RKReachabilityObserver initWithAddress:] in libRestKit.a(RKReachabilityObserver.o)
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[Reachability reachabilityWithHostName:] in Reachability.o
      +[Reachability reachabilityWithHostName:] in test1ViewController.o
      -[RKReachabilityObserver initWithHost:] in libRestKit.a(RKReachabilityObserver.o)
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[Reachability connectionRequired] in Reachability.o
      -[Reachability currentReachabilityStatus] in Reachability.o
      -[Reachability connectionRequired] in test1ViewController.o
      -[Reachability currentReachabilityStatus] in test1ViewController.o
      -[RKReachabilityObserver getFlags] in libRestKit.a(RKReachabilityObserver.o)
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[Reachability startNotifier] in Reachability.o
      -[Reachability startNotifier] in test1ViewController.o
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[Reachability startNotifier] in Reachability.o
      -[Reachability startNotifier] in test1ViewController.o
      -[RKReachabilityObserver scheduleObserver] in libRestKit.a(RKReachabilityObserver.o)
  "_SCNetworkReachabilitySetDispatchQueue", referenced from:
      -[RKReachabilityObserver scheduleObserver] in libRestKit.a(RKReachabilityObserver.o)
      -[RKReachabilityObserver unscheduleObserver] in libRestKit.a(RKReachabilityObserver.o)
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[Reachability stopNotifier] in Reachability.o
      -[Reachability stopNotifier] in test1ViewController.o
ld: symbol(s) not found for architecture i386
4

7 回答 7

11

SCError, SCErrorString, ... 都来自SystemConfiguration.framework,因此目标的“Link Binary With Libraries”设置中似乎缺少。

(在许多情况下,“未定义符号...”链接器错误可以通过在 XCode 文档浏览器中查找不带前导下划线的符号来解决。在文档页面的顶部,您可以找到定义符号的框架。)

于 2012-10-02T13:13:03.033 回答
3

我有一个类似的问题。添加 SystemComfiguration.framework 后,问题就解决了。

于 2012-10-09T07:12:11.433 回答
1

您忘记将 SystemConfiguration.framework 添加到您的项目中。

于 2013-04-01T11:51:51.930 回答
1

尝试创建一个新方案。我在 Xcode 6.3 中看到了类似的错误消息——这为我解决了这个问题。

于 2015-04-21T19:27:30.373 回答
0

看起来您可能忘记包含 RestKit。添加库,看看您是否仍然遇到问题。

于 2012-10-02T12:37:26.413 回答
0

问题很可能是该项目不包括 RestKit。转到您的 Target -> Build Phases -> Link 并验证您实际上是否有 RestKit。

于 2012-10-02T12:59:12.220 回答
0
  1. 添加SystemComfiguration.framework到您的目标。
  2. 还添加#import <SystemConfiguration/SystemConfiguration.h>
于 2018-06-14T17:11:48.867 回答