我不明白:“链接器命令失败并退出代码1”错误

时间:2012-05-07 07:49:42

标签: ios5 storyboard xcode4.3

上周我正在开展一个项目。今天,我重新打开了这个项目并试图再次构建它。但是我收到了一条错误消息。我不明白为什么我收到这条消息因为我没有改变任何项目。 (我正在使用带故事板的XCode 4.3)

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)

2 个答案:

答案 0 :(得分:1)

错误消息非常清楚 - 您在examPaused.o和_counter中定义了两个具有相同名称(examSelf.o)的全局符号。这可能是因为您有两个全局变量或具有相同名称的非静态函数单独定义,或者更常见的是在头文件中定义某些内容然后将其包含/导入到两个或多个源文件中。

答案 1 :(得分:0)

请参阅我在以下链接中提供给您的此解决方案。这可以帮助您

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1