44 votes

Erreur de compilation SCNetworkReachability

J'ai essayé de compiler l'exemple de code d'Ercia Sadun ici , mais cette erreur s'est produite:

 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 avoir ajouté systemConfiguration.framework, il a signalé la même erreur. Pourquoi a-t-il fait cela et comment puis-je le faire fonctionner?

97voto

KennyTM Points 232647

Quel SystemConfiguration.framework avez-vous ajouté? La première ligne clairement énoncée

avertissement: dans /Users/interdev/iphone source code/Web Browser/Classes/SystemConfiguration.framework/SystemConfiguration , il manque l'architecture requise i386 dans le fichier

Mais vous devez ajouter celui du SDK, en /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks .

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

Prograide.com

Prograide est une communauté de développeurs qui cherche à élargir la connaissance de la programmation au-delà de l'anglais.
Pour cela nous avons les plus grands doutes résolus en français et vous pouvez aussi poser vos propres questions ou résoudre celles des autres.

Powered by:

X