2012-05-07 87 views
1

上週我正在開發一個項目。今天,我重新開放了這個項目並試圖再次構建它。但我收到了一條錯誤消息。我不明白爲什麼我收到這條消息是因爲我沒有改變任何項目。 (我使用的XCode 4.3故事板)我不明白:「鏈接器命令失敗,退出代碼1」錯誤

Ld /Users/mete/Library/Developer/Xcode/DerivedData/MySınav-ceckdqzcfyfgicaqrhloynhdnglw/Build/Products/Debug-iphonesimulator/MySınav.app/MySınav normal i386 
cd /Users/mete/Documents/MySınav 
setenv MACOSX_DEPLOYMENT_TARGET 10.6 
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/mete/Library/Developer/Xcode/DerivedData/MySınav-ceckdqzcfyfgicaqrhloynhdnglw/Build/Products/Debug-iphonesimulator -F/Users/mete/Library/Developer/Xcode/DerivedData/MySınav-ceckdqzcfyfgicaqrhloynhdnglw/Build/Products/Debug-iphonesimulator -filelist /Users/mete/Library/Developer/Xcode/DerivedData/MySınav-ceckdqzcfyfgicaqrhloynhdnglw/Build/Intermediates/MySınav.build/Debug-iphonesimulator/MySınav.build/Objects-normal/i386/MySınav.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -lsqlite3 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/mete/Library/Developer/Xcode/DerivedData/MySınav-ceckdqzcfyfgicaqrhloynhdnglw/Build/Products/Debug-iphonesimulator/MySınav.app/MySınav 

ld: duplicate symbol _counter in /Users/mete/Library/Developer/Xcode/DerivedData/MySınav-ceckdqzcfyfgicaqrhloynhdnglw/Build/Intermediates/MySınav.build/Debug-iphonesimulator/MySınav.build/Objects-normal/i386/examPaused.o and /Users/mete/Library/Developer/Xcode/DerivedData/MySınav-ceckdqzcfyfgicaqrhloynhdnglw/Build/Intermediates/MySınav.build/Debug-iphonesimulator/MySınav.build/Objects-normal/i386/examSelf.o for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

回答

1

的錯誤信息是很清楚的 - 你必須同時使用examPaused.o和examSelf.o定義的名稱相同(_counter)兩個全局符號。發生這種情況可能是因爲您有兩個全局變量或具有相同名稱的非靜態函數單獨定義,或者更常見的情況是,您在頭文件中定義了某些內容,然後將其導入到兩個或多個源文件中。

+0

我不慎進口同一類的h和.m文件到另一個班級在同一時間。問題解決了。謝謝。 –

+0

嗨,丈量,我用FBGraph API, 錯誤: LD:重複的符號_OBJC_CLASS _ $ _在/Users/sumitgosh/Library/Developer/Xcode/DerivedData/BoleApp-avgexapsugmcsaexkijxcnqktmdx/Build/Intermediates/BoleApp.build/Debug- SBJSON iphonesimulator/BoleApp.build/Objects-normal/i386/SBJSON-6C85BADD94574567.o和/Users/sumitgosh/Library/Developer/Xcode/DerivedData/BoleApp-avgexapsugmcsaexkijxcnqktmdx/Build/Intermediates/BoleApp.build/Debug-iphonesimulator/BoleApp.build /Objects-normal/i386/SBJSON-58E23D7C54AF5087.o對於體系結構i386 clang:錯誤:鏈接器命令失敗,退出代碼爲1(使用-v查看調用) – NSExpression

+0

你能告訴我,我會在哪裏得到這個SBJSON-58E23D7C54AF5087。 o和SBJSON-6C85BADD94574567.o文件在我的項目中......? – NSExpression

相關問題