生成应用程序时,Apple Mach-O链接器错误 [英] Apple Mach-O Linker Error When Building App
问题描述
duplicate symbol _y in:
/Users/archanamehta/Library/Developer/Xcode/DerivedData/GuideforCODGhosts-ftrljupdxywopwckemagyiliitss/Build/Intermediates/GuideforCODGhosts.build/Debug-iphonesimulator/GuideforCODGhosts.build/Objects-normal/i386/SecondaryWeaponsViewController.o
/Users/archanamehta/Library/Developer/Xcode/DerivedData/GuideforCODGhosts-ftrljupdxywopwckemagyiliitss/Build/Intermediates/GuideforCODGhosts.build/Debug-iphonesimulator/GuideforCODGhosts.build/Objects-normal/i386/PrimaryWeaponsViewController.o
ld:体系结构i386的1个重复符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
ld: 1 duplicate symbol for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)
我的申请中有错误.以上是我得到的错误.我不确定该怎么办.请帮忙.
I have an error in my application. Above is the error I am getting. I am not sure what to do. Please help.
谢谢
编辑 PrimaryWeaponsViewController .h文件的源代码 http://gyazo.com/1dd400959f043bddbc59ec8d0c4f6c60
EDIT Source code for .h file of PrimaryWeaponsViewController http://gyazo.com/1dd400959f043bddbc59ec8d0c4f6c60
.h文件SecondaryWeaponsViewController的源代码 http://gyazo.com/76b3d1fa2b766e904af41489e36cba60
Source code for .h file SecondaryWeaponsViewController http://gyazo.com/76b3d1fa2b766e904af41489e36cba60
推荐答案
提供的错误行包含错误所在的文件的名称:
The error lines provided have the name of the files where the error is:
SecondaryWeaponsViewController
PrimaryWeaponsViewController
查看这些文件.
在没有源代码的情况下,最好的选择是声明一个变量_y为全局变量.请注意,@propertie
的*会自动生成实例变量,并在其前添加一个前导"_" *.
Best bet given no source code is that there is a variable _y that is declared a global. Note that @propertie
s *auto-generate instance variables and add a leading "_"* to them.
发布这些方法的代码,它们的关系以及处理变量"y"的部分/这可以是在两个类都导入的.h头文件中声明的变量.
Post the code for these methods, how they are related and the portions dealing with an variable "y"/ This could be a variable declared in a .h header file that both classes import.
这篇关于生成应用程序时,Apple Mach-O链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!