2

Xcode 4.2, iOS 5.0 我的项目启用了 ARC,当在我的项目中添加非 ARC Reachabilty 类时,出现以下错误:

Undefined symbols for architecture i386:
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[Reachability startNotifier] in Reachability.o
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[Reachability startNotifier] in Reachability.o
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[Reachability stopNotifier] in Reachability.o
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[Reachability reachabilityWithHostName:] in Reachability.o
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[Reachability reachabilityWithAddress:] in Reachability.o
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[Reachability connectionRequired] in Reachability.o
      -[Reachability currentReachabilityStatus] in 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?

于 2012-04-07T09:24:53.803 回答
1

您添加的库似乎只为设备构建,而不是为模拟器构建(这就是为什么它说“找不到架构 i386”)。

找到代码并将其直接添加到您的项目中,您应该能够为设备模拟器构建。

于 2012-04-07T05:46:06.507 回答