IOS -程序使用IOS 6.1模拟器产生一个苹果ch- o链接错误[重复]

时间:2023-02-08 15:59:27

This question already has an answer here:

这个问题已经有了答案:

Hey so I'm using the arc compatible Reachability headers found here https://gist.github.com/darkseed/1182373 and for some reason my code now throws a "Apple Mach-O Linker Error" when I compile it for the iPhone 6.1 and iPad 6.1 simulators. The project compiles on all devices we have tested it on (iPad, iPhone 4, iPhone 3s and iPhone 5) but for some reason fails on the simulators. It seems to have an issue with the newly added reachability .h and .m files, here is the compiler log.

嘿,我正在使用与arc兼容的可访问性标头,在这里可以找到https://gist.github.com/darkseed/1182373,出于某种原因,当我为iPhone 6.1和iPad 6.1模拟器编译时,我的代码现在抛出了一个“Apple Mach-O链接器错误”。该项目在我们测试过的所有设备(iPad、iPhone 4、iPhone 3s和iPhone 5)上进行编译,但出于某种原因,在模拟器上失败了。似乎新添加的.h和.m文件有问题,这是编译器日志。

Ld /Users/scottlarose/Library/Developer/Xcode/DerivedData/Coffee-fvbhtkgwidvsobcpnfvptcvzzrdr/Build/Products/Debug-iphonesimulator/Coffee.app/Coffee normal i386
    cd "/Users/scottlarose/Documents/workspace/xcode workspace/iPhone workspace/Coffee"
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/scottlarose/Library/Developer/Xcode/DerivedData/Coffee-fvbhtkgwidvsobcpnfvptcvzzrdr/Build/Products/Debug-iphonesimulator "-L/Users/scottlarose/Documents/workspace/xcode workspace/iPhone workspace/Coffee/XMPPFramework/XMPPFramework/Vendor/libidn" -F/Users/scottlarose/Library/Developer/Xcode/DerivedData/Coffee-fvbhtkgwidvsobcpnfvptcvzzrdr/Build/Products/Debug-iphonesimulator "-F/Users/scottlarose/Documents/workspace/xcode workspace/iPhone workspace/Coffee" -filelist /Users/scottlarose/Library/Developer/Xcode/DerivedData/Coffee-fvbhtkgwidvsobcpnfvptcvzzrdr/Build/Intermediates/Coffee.build/Debug-iphonesimulator/Coffee.build/Objects-normal/i386/Coffee.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework SystemConfiguration -lresolv -lxml2 -framework Security -framework CFNetwork -framework StoreKit -framework Social -framework QuartzCore -framework MobileCoreServices -lz.1.1.3 -lsqlite3 -framework CoreLocation -framework CoreGraphics -framework AdSupport -framework Accounts -framework AudioToolbox -framework UIKit -framework Foundation -framework Parse -lidn -framework SystemConfiguration -o /Users/scottlarose/Library/Developer/Xcode/DerivedData/Coffee-fvbhtkgwidvsobcpnfvptcvzzrdr/Build/Products/Debug-iphonesimulator/Coffee.app/Coffee

ld: warning: ignoring file /Users/scottlarose/Documents/workspace/xcode workspace/iPhone workspace/Coffee/SystemConfiguration.framework/SystemConfiguration, missing required architecture i386 in file /Users/scottlarose/Documents/workspace/xcode workspace/iPhone workspace/Coffee/SystemConfiguration.framework/SystemConfiguration (2 slices)
Undefined symbols for architecture i386:
  "_SCNetworkReachabilityCreateWithAddress", referenced from:
      +[Reachability reachabilityWithAddress:] in Reachability.o
  "_SCNetworkReachabilityCreateWithName", referenced from:
      +[Reachability reachabilityWithHostName:] in Reachability.o
      -[PFCommandCache init] in Parse(PFCommandCache.o)
      +[PFInternalUtils(Reachability) isParseReachable] in Parse(PFInternalUtils.o)
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[Reachability connectionRequired] in Reachability.o
      -[Reachability currentReachabilityStatus] in Reachability.o
      -[PFCommandCache init] in Parse(PFCommandCache.o)
      +[PFInternalUtils(Reachability) isParseReachable] in Parse(PFInternalUtils.o)
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[Reachability startNotifier] in Reachability.o
      -[PFCommandCache init] in Parse(PFCommandCache.o)
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[Reachability startNotifier] in Reachability.o
      -[PFCommandCache init] in Parse(PFCommandCache.o)
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[Reachability stopNotifier] in Reachability.o
      -[PFCommandCache dealloc] in Parse(PFCommandCache.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

2 个解决方案

#1


1  

For some reason your project doesn't have the required framework. Reachability class needs SystemConfiguration.framework to be execute.

由于某些原因,您的项目没有所需的框架。可达性类需要SystemConfiguration.framework来执行。

#2


0  

That error usually means you have added some code that requires a specific Framework that has not been added to the project.

这个错误通常意味着您添加了一些代码,这些代码需要一个没有添加到项目中的特定框架。

#1


1  

For some reason your project doesn't have the required framework. Reachability class needs SystemConfiguration.framework to be execute.

由于某些原因,您的项目没有所需的框架。可达性类需要SystemConfiguration.framework来执行。

#2


0  

That error usually means you have added some code that requires a specific Framework that has not been added to the project.

这个错误通常意味着您添加了一些代码,这些代码需要一个没有添加到项目中的特定框架。