IOS - 程序使用 IOS 6.1 模拟器产生 Apple Mach-O 链接器错误

标签 ios xcode linker compiler-errors

这个问题在这里已经有了答案:





Undefined symbols for architecture armv7 while integrating speechkit of nuance dragon mobile

(2 个回答)


8年前关闭。




嘿,所以我正在使用此处找到的弧兼容可达性 header 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)

最佳答案

由于某种原因,您的项目没有所需的框架。
可达性上课需要SystemConfiguration.framework被执行。

关于IOS - 程序使用 IOS 6.1 模拟器产生 Apple Mach-O 链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18088051/

相关文章:

ios - 如何在 iPhone 稍微滚动时停止 CLLocationManager 标题值更改。

ios - Struct 中的自初始化错误

iphone - 如何在 iphone sdk 中包含文件 pcap.h?

xcode - 在大团队中使用 git VS Mercurial 和 Xcode 进行 iOS 开发有什么优缺点?

linux - 如何将 libc.a 链接到 arm-linux 中的共享库中使用 arm-none-linux-gnueabi-gcc

gcc - 分析 ELF 二进制文件以最小化其大小

c - 将二进制 blob 与 GCC 链接时的奇怪行为

ios - MonkeyTalk 无法识别 UITextfield 输入事件

ios - Swift 3 上的 NotificationCenter 问题

objective-c - 在 Objective C 中绘制带有渐变的图表