2012-10-02 26 views
3

我將運行在Xcode 4.2上的Mac中的Xcode項目移動到運行Xcode 4.5的另一個Mac中後,我收到以下錯誤。遷移到Xcode 4.5後與Reachability相關的未定義符號

"_SCError", referenced from: 
     -[RKReachabilityObserver scheduleObserver] in libRestKit.a(RKReachabilityObserver.o) 
     -[RKReachabilityObserver unscheduleObserver] in libRestKit.a(RKReachabilityObserver.o) 
    "_SCErrorString", referenced from: 
     -[RKReachabilityObserver scheduleObserver] in libRestKit.a(RKReachabilityObserver.o) 
     -[RKReachabilityObserver unscheduleObserver] in libRestKit.a(RKReachabilityObserver.o) 
    "_SCNetworkReachabilityCreateWithAddress", referenced from: 
     +[Reachability reachabilityWithAddress:] in Reachability.o 
     +[Reachability reachabilityWithAddress:] in test1ViewController.o 
     -[RKReachabilityObserver initWithAddress:] in libRestKit.a(RKReachabilityObserver.o) 
    "_SCNetworkReachabilityCreateWithName", referenced from: 
     +[Reachability reachabilityWithHostName:] in Reachability.o 
     +[Reachability reachabilityWithHostName:] in test1ViewController.o 
     -[RKReachabilityObserver initWithHost:] in libRestKit.a(RKReachabilityObserver.o) 
    "_SCNetworkReachabilityGetFlags", referenced from: 
     -[Reachability connectionRequired] in Reachability.o 
     -[Reachability currentReachabilityStatus] in Reachability.o 
     -[Reachability connectionRequired] in test1ViewController.o 
     -[Reachability currentReachabilityStatus] in test1ViewController.o 
     -[RKReachabilityObserver getFlags] in libRestKit.a(RKReachabilityObserver.o) 
    "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
     -[Reachability startNotifier] in test1ViewController.o 
    "_SCNetworkReachabilitySetCallback", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
     -[Reachability startNotifier] in test1ViewController.o 
     -[RKReachabilityObserver scheduleObserver] in libRestKit.a(RKReachabilityObserver.o) 
    "_SCNetworkReachabilitySetDispatchQueue", referenced from: 
     -[RKReachabilityObserver scheduleObserver] in libRestKit.a(RKReachabilityObserver.o) 
     -[RKReachabilityObserver unscheduleObserver] in libRestKit.a(RKReachabilityObserver.o) 
    "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: 
     -[Reachability stopNotifier] in Reachability.o 
     -[Reachability stopNotifier] in test1ViewController.o 
ld: symbol(s) not found for architecture i386 
+0

@Spynet:我冒昧地撤銷了對這個問題的編輯。這不是代碼,而是鏈接器的逐字輸出,並且格式化得很好。 –

回答

0

看起來你可能已經忘記了包含RestKit。 Add the library,看看你是否仍然有問題。

+0

謝謝@ Inspire48,但庫已添加 – fadd

0

問題很可能是該項目不包括RestKit。轉到您的目標 - >構建階段 - >鏈接,並確認實際上您有RestKit。

10

SCError,SCErrorString,...都來自SystemConfiguration.framework,因此您的目標的「Link Binary With Libraries」設置似乎丟失。在Xcode文檔瀏覽器

(「未定義的符號...」鏈接錯誤在很多情況下可以通過查找符號沒有領先解決下劃線。在文檔頁面的頂部找到框架的地方符號被定義)。

+0

剛剛爲我節省了一堆時間。謝啦。 – Gowiem

3

我有類似的問題。添加SystemComfiguration.framework後,問題就解決了。

1

您忘了將SystemConfiguration.framework添加到您的項目中。

1

嘗試創建一個新的方案。我在Xcode 6.3中看到類似的錯誤信息 - 這爲我解決了它。