嘗試編譯我編寫的簡單程序(密碼)時出現以下錯誤。我知道我有一個重複的符號_OBJC_METACLASS _ $ _ Cipher,但我不確定導致這種情況的原因。我試圖檢查是否意外地輸入了兩次東西,但都很好。任何幫助深表感謝! :)Objective-C和Xcode中的重複符號錯誤
Ld "/Users/Lukas/Library/Developer/Xcode/DerivedData/Caesar_Shift-drfzwlpgygkbcifoefghycamkoya/Build/Products/Debug-iphonesimulator/Caesar Shift.app/Caesar Shift" normal i386
cd "/Users/Lukas/Documents/Programming/iPhone Applications/Caesar Shift"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Developer/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/Lukas/Library/Developer/Xcode/DerivedData/Caesar_Shift-drfzwlpgygkbcifoefghycamkoya/Build/Products/Debug-iphonesimulator -F/Users/Lukas/Library/Developer/Xcode/DerivedData/Caesar_Shift-drfzwlpgygkbcifoefghycamkoya/Build/Products/Debug-iphonesimulator -filelist "/Users/Lukas/Library/Developer/Xcode/DerivedData/Caesar_Shift-drfzwlpgygkbcifoefghycamkoya/Build/Intermediates/Caesar Shift.build/Debug-iphonesimulator/Caesar Shift.build/Objects-normal/i386/Caesar Shift.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 -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/Lukas/Library/Developer/Xcode/DerivedData/Caesar_Shift-drfzwlpgygkbcifoefghycamkoya/Build/Products/Debug-iphonesimulator/Caesar Shift.app/Caesar Shift"
ld: duplicate symbol _OBJC_METACLASS_$_Cipher in /Users/Lukas/Library/Developer/Xcode/DerivedData/Caesar_Shift-drfzwlpgygkbcifoefghycamkoya/Build/Intermediates/Caesar Shift.build/Debug-iphonesimulator/Caesar Shift.build/Objects-normal/i386/CaesarShiftViewController.o and /Users/Lukas/Library/Developer/Xcode/DerivedData/Caesar_Shift-drfzwlpgygkbcifoefghycamkoya/Build/Intermediates/Caesar Shift.build/Debug-iphonesimulator/Caesar Shift.build/Objects-normal/i386/CaesarShiftAppDelegate.o for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
任何相關的代碼?鏈接器中提到的兩個文件以及類最初聲明的頭文件將有所幫助 – 2012-07-30 18:23:31
鏈接器不會說謊! =)您已經在CaesarShiftViewController或CaesarShiftAppDelegate中重新聲明或導入了'Cipher'。仔細檢查你的'.pch'文件。 – MechEthan 2012-07-30 18:28:01