1

上周我在做一个项目。今天,我重新打开了该项目并尝试再次构建它。但我收到一条错误消息。我不明白为什么会收到此消息,因为我没有更改项目的任何内容。(我正在使用带有情节提要的 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)
4

2 回答 2

1

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

于 2012-05-07T08:03:04.323 回答
0

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

命令 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang 失败,退出代码为 1

于 2013-12-10T09:08:06.133 回答