2011-08-18 55 views
34

我用xcode4,在openglES項目 我添加了一些代碼,在應用程序內購買從教程: http://www.raywenderlich.com/2797/introduction-to-in-app-purchases爲i386硬件架構未定義的符號:「_SCNetworkReachabilitySetCallback」

我已經添加SystemConfiguration.framework但發生這樣的錯誤:

Ld /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest normal i386 
    cd /Users/Eros/Desktop/blatestDB 
    setenv MACOSX_DEPLOYMENT_TARGET 10.6 
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Desktop/blatestDB -filelist /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Intermediates/blatest.build/Debug-iphonesimulator/SLQTSOR.build/Objects-normal/i386/blatest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AVFoundation -framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework OpenAL -lz -framework MediaPlayer -framework AVFoundation -framework GameKit -framework StoreKit -o /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest 

Undefined symbols for architecture i386: 
    "_SCNetworkReachabilitySetCallback", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
    "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
    "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: 
     -[Reachability stopNotifier] in Reachability.o 
    "_SCNetworkReachabilityGetFlags", referenced from: 
     -[Reachability currentReachabilityStatus] in Reachability.o 
     -[Reachability connectionRequired] in Reachability.o 
    "_SCNetworkReachabilityCreateWithName", referenced from: 
     +[Reachability reachabilityWithHostName:] in Reachability.o 
    "_SCNetworkReachabilityCreateWithAddress", referenced from: 
     +[Reachability reachabilityWithAddress:] in Reachability.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 

如果我刪除框架引用的錯誤是一樣的。 再次添加沒有任何反應... in -Xlinker 2 -framework基礎框架UIKit [...]我應該看到「-framework SystemConfiguration」對嗎? 爲什麼不在那裏? 有沒有人有想法?

從以項目拉起框架>建立phases->鏈接二進制與圖書館成爲首個框架,我有這個誤差修改:

Ld /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest normal i386 
    cd /Users/Eros/Desktop/blatestDB 
    setenv MACOSX_DEPLOYMENT_TARGET 10.6 
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator -F/Users/Eros/Desktop/blatestDB -filelist /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Intermediates/blatest.build/Debug-iphonesimulator/SLQTSOR.build/Objects-normal/i386/blatest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework SystemConfiguration -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AVFoundation -framework AudioToolbox -framework CoreAudio -framework CoreGraphics -framework OpenAL -lz -framework MediaPlayer -framework AVFoundation -framework GameKit -framework StoreKit -o /Users/Eros/Library/Developer/Xcode/DerivedData/blatest-acmdklrqungznggpjewgxuxqsvwo/Build/Products/Debug-iphonesimulator/blatest.app/blatest 

ld: warning: ignoring file /Users/Eros/Desktop/blatestDB/SystemConfiguration.framework/SystemConfiguration, missing required architecture i386 in file 
Undefined symbols for architecture i386: 
    "_SCNetworkReachabilitySetCallback", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
    "_SCNetworkReachabilityScheduleWithRunLoop", referenced from: 
     -[Reachability startNotifier] in Reachability.o 
    "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from: 
     -[Reachability stopNotifier] in Reachability.o 
    "_SCNetworkReachabilityGetFlags", referenced from: 
     -[Reachability currentReachabilityStatus] in Reachability.o 
     -[Reachability connectionRequired] in Reachability.o 
    "_SCNetworkReachabilityCreateWithName", referenced from: 
     +[Reachability reachabilityWithHostName:] in Reachability.o 
    "_SCNetworkReachabilityCreateWithAddress", referenced from: 
     +[Reachability reachabilityWithAddress:] in Reachability.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 

SystemConfiguration是存在的,錯誤仍然存​​在... 它會是什麼? 謝謝

回答

51

找到了! 我已經將SystemConfiguration.framework複製到我的項目文件夾(當我從xcode添加時檢查框)。 刪除我的項目中的文件夾現在編譯好了

0

我想指出我也有類似的問題。

我將一些文件複製到xcode中,並意外地選擇了「ProjectTests」而不是項目。只需刪除這些文件並將它們重新添加到項目中,確保選擇了主項目(而不是單元測試)

0

從回購更新後,我遇到了同樣的問題。

我工作的解決方案是從項目中刪除所有類的引用並再次添加它們。問題在於有很大的可能性搞砸了回購同步。

+0

你是怎麼做到的? – quantumpotato

10

我也有同樣的問題。我直接添加了一些框架,拖放它們。

要解決這個問題,我刪除了所有的人,並增加他們通過菜單目標>構建階段,然後再通過鏈接二進制與圖書館添加了所有需要的框架。

之後,你的代碼應該再次正常工作。

+0

+1謝謝你,它的作品....! – Dinesh

37

從構建階段我的項目編譯孔加入SystemConfiguration.framework後...

有一個有趣的...!

+1

謝謝......對我有用! –

+1

這是最正確的答案 –

+0

謝謝!這也適用於我! – ChemDev

8

很簡單。

scnetworkreachability回調被標記爲這意味着一些圖書館或框架文件未定義的符號丟失

前綴SC意味着系統配置

  • 點擊項目名稱選擇摘要在右側

  • cl ICK 鏈接的二進制文件和框架

  • 點擊再加上它,那麼你可以看到一個鑽下來的框架和libaries看藏品有沒有什麼所謂的 systemConfigurationframework

  • 選擇,然後按ok

  • 現在構建運行問題是解決

5

當我使用AFNetworking,收到這些錯誤進口3個框架

CFNetwork.framework 
Security.framework 
SystemConfiguration.framework 

所有錯誤都將消失後..享受!

5

如上所述,導入以下3個框架後,它就可以工作!

CFNetwork.framework 
    Security.framework 
    SystemConfiguration.framework 

非常感謝!

相關問題