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

发布于 2024-11-30 16:27:20 字数 5609 浏览 2 评论 0原文

我在 openglES 项目上使用 xcode4 我从教程中添加了用于应用内购买的代码: http://www.raywenderlich.com/2797/introduction-to-应用内购买

我添加了 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 Foundation -framework UIKit [...] 中我应该看到“-framework SystemConfiguration”吗? 为什么不存在? 有人有想法吗?

从项目中拉出框架 - >构建阶段 - >将二进制文件与库链接,使其成为第一个框架我有这个错误:

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

系统配置在那里,错误仍然存​​在...... 它会是什么? 谢谢

I use xcode4, on a openglES project
i have added code for in-app purchase from the tutorial:
http://www.raywenderlich.com/2797/introduction-to-in-app-purchases

i have added SystemConfiguration.framework but this errors occurs:

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

if i delete framework reference the error is the same.
adding again nothing happens...
in -Xlinker 2 -framework Foundation -framework UIKit [...] should i see "-framework SystemConfiguration" right?
why is not there?
do anyone has ideas?

pulling up the framework from the project->build phases->link binary with library making it the first framework i have this 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 is there, the error still there...
what can it be?
thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

何时共饮酒 2024-12-07 16:27:20

找到了!
我已将 SystemConfiguration.framework 复制到我的项目文件夹中(当我从 xcode 添加时选中该框)。
现在删除我的项目中的该文件夹可以很好地编译

found it!
i have copied the SystemConfiguration.framework into my project folder (checking the box when i added from xcode).
deleting that folder in my project now compiles well

守护在此方 2024-12-07 16:27:20

从构建阶段添加 SystemConfiguration.framework 后,我的项目编译良好......

玩得开心......!

After adding SystemConfiguration.framework from build phases my project compiles well...

have a fun...!

假装爱人 2024-12-07 16:27:20

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

为了解决这个问题,我删除了所有这些框架,并通过菜单目标>构建阶段添加它们,然后再次通过链接二进制文件与库添加所有需要的框架。

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

I had also the same problem. I added some frameworks directly with dragging and dropping them.

To resolve it, I deleted all of them and added them through the menu Target>Build Phases and then again added all needed frameworks through Link Binary With Libraries.

After this, your code should be working fine again.

七月上 2024-12-07 16:27:20

这很简单。

scnetworkreachability 回调被标记为未定义符号,这意味着某些库或框架文件缺少

前缀 sc 表示系统配置

  • 单击项目名称选择右侧的摘要

  • 单击链接二进制文件和框架< /p>

  • 点击上面的加号,然后您可以看到框架和库的集合进行深入分析,看看是否有任何名为
    systemConfigurationframework

  • 选择它并按确定

  • 现在构建运行问题已解决

it's simple.

scnetworkreachability callback is labeled as undefined symbol which implies some library or framework file is missing

the prefix sc means system configuration

  • click on the project name choose Summary on right side

  • click link binaries and frameworks

  • click plus on it then you can see a drill down with collections of frameworks and libaries see if there is anything called
    systemConfigurationframework

  • select that and press ok

  • Now build and run the problem is solved

深陷 2024-12-07 16:27:20

当我使用 AFNetworking 时,在导入 3 个框架时出现这些错误后,

CFNetwork.framework
Security.framework
SystemConfiguration.framework

所有错误都会消失..享受吧!

When i was using AFNetworking, after getting these errors imported 3 frameworks

CFNetwork.framework
Security.framework
SystemConfiguration.framework

All errors will gone.. enjoy !!!

剩一世无双 2024-12-07 16:27:20

如上所述,导入以下3个框架后,就可以了!

    CFNetwork.framework
    Security.framework
    SystemConfiguration.framework

多谢!

As mentioned above, after importing the following 3 frameworks, it works!

    CFNetwork.framework
    Security.framework
    SystemConfiguration.framework

Thanks a lot!

如梦 2024-12-07 16:27:20

我想指出我也遇到了与此类似的问题。

我将一些文件复制到 xcode 中,并且意外地选择了“ProjectTests”而不是项目。只需删除文件并将它们重新添加到您的项目中,确保选择主项目(而不是单元测试)

I would like to point out I also got a problem simular to this.

I copied some files over to xcode and accidently had "ProjectTests" selected instead of the project. Just delete the files and re-add them to your project making sure the main project ( not the unit tests) is selected

丑疤怪 2024-12-07 16:27:20

从仓库更新后我遇到了同样的问题。

对我有用的解决方案是从项目中删除所有类的引用,然后再次添加它们。问题是很可能会搞乱存储库同步。

I had the same problem after an update from repo.

The solution that worked for me was to delete references from project for all classes and add them again. The problem is that there is a big possibility to mess up the repo synchronization.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文