开发者

SCNetworkReachability compiling error

开发者 https://www.devze.com 2022-12-22 14:12 出处:网络
I tried to compile Ercia Sadun\'s sample code he开发者_如何学Cre, but this error came up: warning: in /Users/interdev/iphone source code/Web Browser/Classes/SystemConfiguration.framework/SystemConfig

I tried to compile Ercia Sadun's sample code he开发者_如何学Cre, but this error came up:

warning: in /Users/interdev/iphone source code/Web Browser/Classes/SystemConfiguration.framework/SystemConfiguration, missing required architecture i386 in file
    Undefined symbols:
      "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
          +[UIDevice(Reachability) scheduleReachabilityWatcher:] in UIDevice-Reachability.o
      "_SCNetworkReachabilityCreateWithAddress", referenced from:
          +[UIDevice(Reachability) hostAvailable:] in UIDevice-Reachability.o
          +[UIDevice(Reachability) pingReachabilityInternal] in UIDevice-Reachability.o
      "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
          +[UIDevice(Reachability) unscheduleReachabilityWatcher] in UIDevice-Reachability.o
      "_SCNetworkReachabilitySetCallback", referenced from:
          +[UIDevice(Reachability) scheduleReachabilityWatcher:] in UIDevice-Reachability.o
          +[UIDevice(Reachability) scheduleReachabilityWatcher:] in UIDevice-Reachability.o
          +[UIDevice(Reachability) unscheduleReachabilityWatcher] in UIDevice-Reachability.o
      "_SCNetworkReachabilityGetFlags", referenced from:
          +[UIDevice(Reachability) hostAvailable:] in UIDevice-Reachability.o
          +[UIDevice(Reachability) pingReachabilityInternal] in UIDevice-Reachability.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
        "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
            +[UIDevice(Reachability) scheduleReachabilityWatcher:] in UIDevice-Reachability.o
        "_SCNetworkReachabilityCreateWithAddress", referenced from:
            +[UIDevice(Reachability) hostAvailable:] in UIDevice-Reachability.o
            +[UIDevice(Reachability) pingReachabilityInternal] in UIDevice-Reachability.o
        "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
            +[UIDevice(Reachability) unscheduleReachabilityWatcher] in UIDevice-Reachability.o
        "_SCNetworkReachabilitySetCallback", referenced from:
            +[UIDevice(Reachability) scheduleReachabilityWatcher:] in UIDevice-Reachability.o
            +[UIDevice(Reachability) scheduleReachabilityWatcher:] in UIDevice-Reachability.o
            +[UIDevice(Reachability) unscheduleReachabilityWatcher] in UIDevice-Reachability.o
        "_SCNetworkReachabilityGetFlags", referenced from:
            +[UIDevice(Reachability) hostAvailable:] in UIDevice-Reachability.o
            +[UIDevice(Reachability) pingReachabilityInternal] in UIDevice-Reachability.o
      ld: symbol(s) not found
      collect2: ld returned 1 exit status
    Build failed (5 errors)

...Even after I added systemConfiguration.framework, it reported the same error. Why did it do this, and how can I make it work?


Which SystemConfiguration.framework did you add? The first line clearly stated

warning: in /Users/interdev/iphone source code/Web Browser/Classes/SystemConfiguration.framework/SystemConfiguration, missing required architecture i386 in file

But you should add the SDK one, in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks.

The framework should be added by "Add Existing Framework..." in the right-click menu on the project.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号