tags:

views:

598

answers:

1

Hello everyone

I try to compile Ercia Sadun's sample codes at:

http://github.com/erica/iphone-3.0-cookbook-/tree/master/C13-Networking/14-Web%20Browser/

There is error reported :

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 I added systemConfiguration.framework, it reported same error.

Welcome any comment

Thanks interdev

+1  A: 

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/ etc.

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

KennyTM
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks/SystemConfiguration.framework
@user If you are compiling for simulator the path should be `/Dev/Pl/`**`iPhoneSimulator.platform`**`/Dev/SDKs/`**`iPhoneSimulator3.1.sdk`**`/Sys/Lib/Fr/SysConf.fr`. Select the SysConf framework, view Info, and select "relative to current SDK".
KennyTM
I try to add the framework you said, but when I check by clicking 'Getinfo'it still points to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks/SystemConfiguration.frameworkI checked Erica Sadun's project, it works well now.but if I add their source codes to my project, the error still exists.
@user: You need to select "relative to current SDK" for your project as well, not just Erica's.
KennyTM
I fixed itThanks a lotKennyTM