架构i386的未定义符号:“_SCNetworkReachabilitySetCallback”

我使用xcode4,在一个openglES项目上,我已经添加了从应用程序购买代码从教程: http ://www.raywenderlich.com/2797/introduction-to-in-app-purchases

我已经添加了SystemConfiguration.framework但发生此错误:

Ld /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest normal i386 cd /Users/Eros/Desktop/blatestDB setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Desktop/blatestDB -filelist /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Intermediates/blatest.build/Debug-iphonesimulator/SLQTSOR.build/Objects-normal/i386/blatest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AVFoundation -framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework OpenAL -lz -framework MediaPlayer -framework AVFoundation -framework GameKit -framework StoreKit -o /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest Undefined symbols for architecture i386: "_SCNetworkReachabilitySetCallback", referenced from: -[Reachability startNotifier] in Reachability.o "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: -[Reachability startNotifier] in Reachability.o "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: -[Reachability stopNotifier] in Reachability.o "_SCNetworkReachabilityGetFlags", referenced from: -[Reachability currentReachabilityStatus] in Reachability.o -[Reachability connectionRequired] in Reachability.o "_SCNetworkReachabilityCreateWithName", referenced from: +[Reachability reachabilityWithHostName:] in Reachability.o "_SCNetworkReachabilityCreateWithAddress", referenced from: +[Reachability reachabilityWithAddress:] in Reachability.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status 

如果我删除框架引用的错误是一样的。 再次增加没有任何反应…在-Xlinker 2 -framework基础框架UIKit […]我应该看到“框架SystemConfiguration”对吗? 为什么不在那里? 有没有人有想法?

从项目 – >构build阶段 – >链接二进制与库使它成为第一个框架,我有这个erros:

 Ld /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest normal i386 cd /Users/Eros/Desktop/blatestDB setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Desktop/blatestDB -filelist /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Intermediates/blatest.build/Debug-iphonesimulator/SLQTSOR.build/Objects-normal/i386/blatest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework SystemConfiguration -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AVFoundation -framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework OpenAL -lz -framework MediaPlayer -framework AVFoundation -framework GameKit -framework StoreKit -o /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest ld: warning: ignoring file /Users/Eros/Desktop/blatestDB/SystemConfiguration.framework/SystemConfiguration, missing required architecture i386 in file Undefined symbols for architecture i386: "_SCNetworkReachabilitySetCallback", referenced from: -[Reachability startNotifier] in Reachability.o "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: -[Reachability startNotifier] in Reachability.o "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: -[Reachability stopNotifier] in Reachability.o "_SCNetworkReachabilityGetFlags", referenced from: -[Reachability currentReachabilityStatus] in Reachability.o -[Reachability connectionRequired] in Reachability.o "_SCNetworkReachabilityCreateWithName", referenced from: +[Reachability reachabilityWithHostName:] in Reachability.o "_SCNetworkReachabilityCreateWithAddress", referenced from: +[Reachability reachabilityWithAddress:] in Reachability.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status 

SystemConfiguration在那里,错误仍然存​​在…它可能是什么? 谢谢

find了! 我已经将SystemConfiguration.framework复制到我的项目文件夹(当我从xcode添加时检查框)。 删除我的项目中的文件夹现在编译好

从构build阶段添加SystemConfiguration.framework ,我的项目编译好…

玩得开心!

我也有同样的问题。 我直接添加了一些框架,拖放它们。

为了解决这个问题,我把它们全部删除,并通过菜单Target> Build Phases添加它们,然后通过Link Binary With Libraries再次添加所有需要的框架。

在此之后,您的代码应该再次正常工作。

这很简单。

scnetworkreachabilitycallback被标记为未定义的符号,这意味着一些库或框架文件丢失

前缀sc表示系统configuration

  • 点击项目名称右侧的摘要

  • 点击链接二进制文件和框架

  • 点击加上它,然后你可以看到一个框架和库的收集深入查看是否有什么叫systemConfigurationframework

  • select并按下确定

  • 现在build立运行问题就解决了

当我使用AFNetworking时,得到这些错误后导入了3个框架

 CFNetwork.framework Security.framework SystemConfiguration.framework 

所有的错误将消失..享受!

如上所述,在导入以下3个框架之后,它就起作用了!

  CFNetwork.framework Security.framework SystemConfiguration.framework 

非常感谢!

我想指出,我也有类似的问题。

我将一些文件复制到xcode中,并意外地select了“ProjectTests”而不是项目。 只要删除这些文件,并将它们重新添加到您的项目中,确保select了主项目(而不是unit testing)

从回购更新后,我有同样的问题。

我的解决scheme是从项目中删除所有类的引用,并再次添加它们。 问题是有一个很大的可能性搞砸回购同步。