Ios 重复符号-链接器命令失败,退出代码为1(使用-v查看调用)?

Ios 重复符号-链接器命令失败,退出代码为1(使用-v查看调用)?,ios,objective-c,linker-errors,duplicate-symbol,Ios,Objective C,Linker Errors,Duplicate Symbol,根据教程构建iOS应用程序,我收到以下消息: Ld /Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame-ekyyaqwhjsjimddxggwkkkgblylu/Build/Products/Debug-iphonesimulator/FirstGame.app/FirstGame normal i386 cd /Users/EvanBresnan/Documents/Xcode/FirstGame e

根据教程构建iOS应用程序,我收到以下消息:

Ld /Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame-ekyyaqwhjsjimddxggwkkkgblylu/Build/Products/Debug-iphonesimulator/FirstGame.app/FirstGame normal i386 cd /Users/EvanBresnan/Documents/Xcode/FirstGame export IPHONEOS_DEPLOYMENT_TARGET=9.2 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/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/iPhoneSimulator9.2.sdk -L/Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame-ekyyaqwhjsjimddxggwkkkgblylu/Build/Products/Debug-iphonesimulator -F/Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame-ekyyaqwhjsjimddxggwkkkgblylu/Build/Products/Debug-iphonesimulator -filelist /Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame-ekyyaqwhjsjimddxggwkkkgblylu/Build/Intermediates/FirstGame.build/Debug-iphonesimulator/FirstGame.build/Objects-normal/i386/FirstGame.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.2 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -dependency_info -Xlinker /Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame-ekyyaqwhjsjimddxggwkkkgblylu/Build/Intermediates/FirstGame.build/Debug-iphonesimulator/FirstGame.build/Objects-normal/i386/FirstGame_dependency_info.dat -o /Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame-ekyyaqwhjsjimddxggwkkkgblylu/Build/Products/Debug-iphonesimulator/FirstGame.app/FirstGame duplicate symbol _HighScoreNumber in: /Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame-ekyyaqwhjsjimddxggwkkkgblylu/Build/Intermediates/FirstGame.build/Debug-iphonesimulator/FirstGame.build/Objects-normal/i386/ViewController.o /Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame-ekyyaqwhjsjimddxggwkkkgblylu/Build/Intermediates/FirstGame.build/Debug-iphonesimulator/FirstGame.build/Objects-normal/i386/Game.o ld: 1 duplicate symbol for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) Ld/Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame ekyyaqwhjsjimddxggwkkgblylu/Build/Products/Debug iphonesimulator/FirstGame.app/FirstGame normal i386 cd/Users/EvanBresnan/Documents/Xcode/FirstGame 导出IPHONEOS_部署_目标=9.2 export 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/iPhoneSimulator9.2.sdk-L/Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame ekyyaqwhjsjimddxggwkkblylu/Build/Products/Debug iphonesimulator-F/Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame ekyyaqwhjsjimddxggwkkblylu/Build/Products/Debug iphonesimulator-filelist/Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame ekyyqwhjsjimddxggwkkkblylu/Build/mediates/FirstGame.Build/Debug-iphonesimulator/FirstGame.Build/Objects-normal/i386/FirstGame.LinkFileList-Xlinker-可执行路径/框架-mios模拟器版本min=9.2-Xlinker-objc\u abi版本-fobjc arc-fobjc链接运行时-Xlinker-dependency_info-Xlinker/Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame ekyqwhjsjimddxggwkkkblylu/Build/mediates/FirstGame.Build/Debug-iphonesimulator/FirstGame.Build/Objects-normal/i386/FirstGame_dependency_-info.dat-o/用户/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame ekyyaqwhjsjimddxggwkkkblylu/Build/Products/Debug iphonesimulator/FirstGame.app/FirstGame 重复符号\u HighScoreNumber在: /Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame ekyyaqwhjsjimddxggwkkkblylu/Build/Intermediates/FirstGame.Build/Debug iphonesimulator/FirstGame.Build/Objects normal/i386/ViewController.o /Users/EvanBresnan/Library/Developer/Xcode/DerivedData/FirstGame ekyyaqwhjsjimddxggwkkkblylu/Build/Intermediates/FirstGame.Build/Debug iphonesimulator/FirstGame.Build/Objects normal/i386/Game.o ld:架构i386的1个重复符号 叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用) 从错误消息

duplicate symbol _HighScoreNumber in:...

我猜您在两个文件中声明了全局变量_HighScoreNumber(或者可能在导入到两个文件中的头文件中)。检查HighScoreNumber在何处以及如何声明,并将其移动到正确的位置。

我最近遇到了同样的问题。我知道E.Brez得到了答案,但他是为了帮助那些可能与我有同样问题的人。
根据我的申请流程,我正在使用与打印机相关的第三方类进行打印。为了使用它,我在我的两个文件
ImagePrintViewController
PrintResultViewController
中分别创建了该类的对象,并将所需的数据传递给它

在我的场景中,在我的两个文件
/Library/Developer/Xcode/DerivedData/./x86\u 64/ImagePrintViewController.o
/Library/Developer/Xcode/DerivedData/./x86_64/PrintResultViewController.o

我在两个文件中都搜索了上述变量名。但我找不到。

经过长时间的搜索,我想出了一个主意,在第一个文件中合并代码后,删除第二个文件的引用,即
BRPrintResultViewController.h
BRPrintResultViewController.m


有了它,我找到了解决方案,之后我的代码运行良好。

欢迎使用SO!它可能有助于发布您试图实现的代码片段。如果不知道您正在构建什么或代码在哪里中断,就很难提供帮助。谢谢!youtube上的一些教程讲述了如何制作一个马特·海尼(Matt Heany)设计的飞禽式应用程序。这是我第一次编写代码,所以我几乎不知道我在做什么,也找不到哪里出错了我最终让它工作了,但感谢你的帮助,现在我在smh的程序中还有其他问题。。。