我正在尝试在我的项目中使用可达性。我添加了Reacvicity.h和Reacviity.m文件。但是在构建项目之后,xCode显示了一些奇怪的错误:
Undefined symbols for architecture i386:
"_SCNetworkReachabilityCreateWithName", referenced from:
+[Reachability reachabilityWithHostname:] in Reachability.o
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[Reachability reachabilityWithAddress:] in Reachability.o
"_SCNetworkReachabilitySetCallback", referenced from:
-[Reachability startNotifier] in Reachability.o
-[Reachability stopNotifier] in Reachability.o
"_SCError", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCErrorString", referenced from:
-[Reachability startNotifier] in Reachability.o
"_SCNetworkReachabilitySetDispatchQueue", referenced from:
-[Reachability startNotifier] in Reachability.o
-[Reachability stopNotifier] in Reachability.o
"_SCNetworkReachabilityGetFlags", referenced from:
-[Reachability isReachable] in Reachability.o
-[Reachability isReachableViaWWAN] in Reachability.o
-[Reachability isReachableViaWiFi] in Reachability.o
-[Reachability connectionRequired] in Reachability.o
-[Reachability isConnectionOnDemand] in Reachability.o
-[Reachability isInterventionRequired] in Reachability.o
-[Reachability reachabilityFlags] in Reachability.o
我该如何解决这个问题?
发布于 2012-06-13 19:37:51
可能您忘了将SystemConfiguration.framework添加到项目中。如果你不知道如何添加一个框架,可以看看这个SO question。
发布于 2012-06-13 19:42:07
添加这些框架..SystemConfiguration.framework Security.framework CFNetwork.framework
https://stackoverflow.com/questions/11013997
复制相似问题