如何修复“Apple Mach-O 链接器错误组 - clang: 错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)"错误 [英] How to fix "Apple Mach-O Linker Error Group - clang: error: linker command failed with exit code 1 (use -v to see invocation)" Error

查看:38
本文介绍了如何修复“Apple Mach-O 链接器错误组 - clang: 错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用单页应用程序创建了一个新项目,然后我删除了 ViewController.h 和 .m 文件,也删除了我的故事板,因为我想用 UITableView 子类创建一个新类,在我构建新的故事板并更改主故事板之后将 info.plist 文件中的文件基本名称添加到新故事板,然后出现此错误:

i create a new project with single page application, then i removed ViewController.h and .m file also deleted my story boards because i wanted to make a new class with UITableView subclass, after i build new storyBoard and changed the Main storyboard file base name in info.plist file to the new storyboard then i've got this error:

Apple Mach-O 链接器错误组clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Apple Mach-O Linker Error Group clang: error: linker command failed with exit code 1 (use -v to see invocation)

有人可以帮我吗?

我想出了一些办法,当我从我的 .xcdatamodeld 核心数据文件创建 NSManagedSubclass 时,它为每个实体创建了 4 个子类,如下图:

i figured out something, when i create NSManagedSubclass from my .xcdatamodeld core data file, it make 4 sub class for each entity like the pictur below:

这就是问题产生的地方,我读到问题是重复的文件,可能是重复的#import语法,我不知道如何解决这个问题我试图通过将每个实体的2个.h文件放在一起来解决它,但是它没有用,我有更多的错误,所以如果你们帮助我,我很感激.

and thats where the problem will create, i read that the problem is dublicate file, maybe duplicate #import syntax, i dont know how to fix this i tried to fix it by put the 2 .h file for each entity together but it didnt work and i've got more errors, so i appreciate if you guys help me.

这是日志:

重复符号_OBJC_CLASS_$_注意:/Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejlezioxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Note+CoreDataClass.o重复符号_OBJC_METACLASS_$_注意:/Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejlezioxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Note+CoreDataClass.o重复符号 _OBJC_CLASS_$_Setting 在:/Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejlezioxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Setting+CoreDataClass.o重复符号 _OBJC_METACLASS_$_Setting 在:/Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejlezioxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Setting+CoreDataClass.old:架构 x86_64 的 4 个重复符号clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

duplicate symbol _OBJC_CLASS_$_Note in: /Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Note+CoreDataClass.o duplicate symbol _OBJC_METACLASS_$_Note in: /Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Note+CoreDataClass.o duplicate symbol _OBJC_CLASS_$_Setting in: /Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Setting+CoreDataClass.o duplicate symbol _OBJC_METACLASS_$_Setting in: /Users/arashafshar/Library/Developer/Xcode/DerivedData/To_Dooz-eixtgqgyctrejleziaoxshnkdnym/Build/Intermediates/To Dooz.build/Debug-iphonesimulator/To Dooz.build/Objects-normal/x86_64/Setting+CoreDataClass.o ld: 4 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

推荐答案

仔细遵循 此技术问答.我认为您可能没有完成第一张图中的第 2 步,您需要在Codegen"下拉列表中选择Manual/None".

Follow carefully the instructions in this Technical Q&A. I think you might have not done step 2 in the first figure, where you need to select "Manual/None" in the "Codegen" dropdown.

这篇关于如何修复“Apple Mach-O 链接器错误组 - clang: 错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆