iOS :undefined symbols for architecture x86_64

问题描述:为了适配iPhone 5s的64位处理器,在编译选项中加入了arm64架构。但是发现工程在真机上可以编译通过但是在模拟器上却未编过。

问题解决:经研究在编译选项中再加入x86_64架构,重新编译工程就可以在模拟器上编译成功了.

可以这样理解armv7 , armv7s对应真机的32位处理器,i386对应模拟器的32位模拟器;arm64对应真机的64位模拟器,x86_64对应模拟器的64位模拟器。

没有相关的框架引入工程

Undefined symbols for architecture i386: 
"_SCError", referenced from: 
-[Reachability startNotifier] in Reachability.o 
"_SCErrorString", referenced from: 
-[Reachability startNotifier] in Reachability.o 
"_SCNetworkReachabilityCreateWithAddress", referenced from: 
+[Reachability reachabilityWithAddress:] in Reachability.o 
"_SCNetworkReachabilityCreateWithName", referenced from: 
+[Reachability reachabilityWithHostname:] 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 
... 
"_SCNetworkReachabilitySetCallback", referenced from: 
-[Reachability startNotifier] in Reachability.o 
-[Reachability stopNotifier] in Reachability.o 
"_SCNetworkReachabilitySetDispatchQueue", referenced from: 
-[Reachability startNotifier] in Reachability.o 
-[Reachability stopNotifier] 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)

参考这个: http://stackoverflow.com/questions/11013997/strange-errors-in-apples-reachability-files
得加入:SystemConfiguration.framework

你可能感兴趣的:(iOS :undefined symbols for architecture x86_64)