2010-03-09 6 views
43

j'ai essayé de compiler le code exemple de Ercia Sadun here, mais cette erreur est venu:SCNetworkReachability compilation erreur

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) 

... Même après systemConfiguration.framework ajouté, il a signalé la même erreur. Pourquoi l'a-t-il fait et comment puis-je le faire fonctionner?

Répondre

95

De quel framework SystemConfiguration avez-vous ajouté? La première ligne a clairement indiqué

avertissement: en /Users/interdev/iphone source code/Web Browser/Classes/SystemConfiguration.framework/SystemConfiguration, manquant l'architecture nécessaire i386 dans le fichier

Mais vous devez ajouter le SDK un, dans /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks.

Le cadre devrait être ajouté par "Ajouter un cadre existant ..." dans le menu contextuel du projet.

+2

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks/SystemConfiguration.frameame – arachide

+0

@user Si vous compilez pour le simulateur, le chemin doit être '/ Dev/Pl/'**' iPhoneSimulator.platform' ** '/ Dev/SDKs /' ** 'iPhoneSimulator3.1.sdk' **'/Sys/Lib/Fr/SysConf.fr'. Sélectionnez le framework SysConf, affichez Info et sélectionnez "relatif au SDK actuel". – kennytm

+0

J'essaie d'ajouter le cadre que vous avez dit, mais quand je vérifie en cliquant sur 'Getinfo' il pointe toujours à /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks /SystemConfiguration.framework J'ai vérifié le projet d'Erica Sadun, ça marche bien maintenant. mais si j'ajoute leurs codes source à mon projet, l'erreur persiste. – arachide