使用 Tonymillion Rechability 时出现链接器命令失败错误 class
Linker command failed error when using Tonymillion Rechability class
我在 tonymillion Reachability class 中收到此链接错误。我正在使用它在我的 ios 应用程序中获取互联网连接。谁能告诉我为什么会出现这个错误。
Ld /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos/ResQ-mobile.app/ResQ-mobile normal arm64
cd /Users/Mathaly/Desktop/Gunjan/Business/LogicRoots/Game/Mathaly2/proj.ios_mac
export IPHONEOS_DEPLOYMENT_TARGET=6.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -L/Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos -F/Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos -filelist /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Intermediates/ResQ.build/Debug-iphoneos/ResQ.build/Objects-normal/arm64/ResQ-mobile.LinkFileList -dead_strip -stdlib=libc++ -fobjc-link-runtime -miphoneos-version-min=6.0 -liconv -framework Security /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos/libcocos2d\ iOS.a -framework CoreMotion -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenGLES -lz -framework QuartzCore -framework OpenAL -framework AVFoundation -framework AudioToolbox -Xlinker -dependency_info -Xlinker /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Intermediates/ResQ.build/Debug-iphoneos/ResQ.build/Objects-normal/arm64/ResQ-mobile_dependency_info.dat -o /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos/ResQ-mobile.app/ResQ-mobile
Undefined symbols for architecture arm64:
"_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
...
"_SCNetworkReachabilitySetDispatchQueue", referenced from:
-[Reachability startNotifier] in Reachability.o
-[Reachability stopNotifier] in Reachability.o
"_SCNetworkReachabilitySetCallback", referenced from:
-[Reachability startNotifier] in Reachability.o
-[Reachability stopNotifier] in Reachability.o
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[Reachability reachabilityWithAddress:] in Reachability.o
"_SCNetworkReachabilityCreateWithName", referenced from:
+[Reachability reachabilityWithHostname:] in Reachability.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
添加 SystemConfiguration Framework 并将部署目标更改为 IOS 6.0 解决了我的问题。
1) 要添加系统配置框架:Select 您的项目,然后 select 您的目标 (mobile/tablet),然后 select 构建阶段
有一个名为 Link Binary with Libraries 的块,在它的末尾有 + 号,单击它。它将打开一个对话框,在其中搜索系统配置,然后单击 ok/add。
2) 要更改部署目标:Select 您的项目,然后 select 您的目标 (mobile/tablet),然后 select 构建设置。
有deployment块然后IOSDeployment Target,改成IOS6.0以上
希望这会有所帮助
我在 tonymillion Reachability class 中收到此链接错误。我正在使用它在我的 ios 应用程序中获取互联网连接。谁能告诉我为什么会出现这个错误。
Ld /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos/ResQ-mobile.app/ResQ-mobile normal arm64
cd /Users/Mathaly/Desktop/Gunjan/Business/LogicRoots/Game/Mathaly2/proj.ios_mac
export IPHONEOS_DEPLOYMENT_TARGET=6.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -L/Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos -F/Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos -filelist /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Intermediates/ResQ.build/Debug-iphoneos/ResQ.build/Objects-normal/arm64/ResQ-mobile.LinkFileList -dead_strip -stdlib=libc++ -fobjc-link-runtime -miphoneos-version-min=6.0 -liconv -framework Security /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos/libcocos2d\ iOS.a -framework CoreMotion -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenGLES -lz -framework QuartzCore -framework OpenAL -framework AVFoundation -framework AudioToolbox -Xlinker -dependency_info -Xlinker /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Intermediates/ResQ.build/Debug-iphoneos/ResQ.build/Objects-normal/arm64/ResQ-mobile_dependency_info.dat -o /Users/Mathaly/Library/Developer/Xcode/DerivedData/ResQ-bkakeqfqsmrivngctueeyzttnpno/Build/Products/Debug-iphoneos/ResQ-mobile.app/ResQ-mobile
Undefined symbols for architecture arm64:
"_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
...
"_SCNetworkReachabilitySetDispatchQueue", referenced from:
-[Reachability startNotifier] in Reachability.o
-[Reachability stopNotifier] in Reachability.o
"_SCNetworkReachabilitySetCallback", referenced from:
-[Reachability startNotifier] in Reachability.o
-[Reachability stopNotifier] in Reachability.o
"_SCNetworkReachabilityCreateWithAddress", referenced from:
+[Reachability reachabilityWithAddress:] in Reachability.o
"_SCNetworkReachabilityCreateWithName", referenced from:
+[Reachability reachabilityWithHostname:] in Reachability.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
添加 SystemConfiguration Framework 并将部署目标更改为 IOS 6.0 解决了我的问题。
1) 要添加系统配置框架:Select 您的项目,然后 select 您的目标 (mobile/tablet),然后 select 构建阶段
有一个名为 Link Binary with Libraries 的块,在它的末尾有 + 号,单击它。它将打开一个对话框,在其中搜索系统配置,然后单击 ok/add。
2) 要更改部署目标:Select 您的项目,然后 select 您的目标 (mobile/tablet),然后 select 构建设置。
有deployment块然后IOSDeployment Target,改成IOS6.0以上
希望这会有所帮助