在Objective-C构建中出现重复的符号错误? [英] Duplicate Symbol Error in Objective-C build?

查看:140
本文介绍了在Objective-C构建中出现重复的符号错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按build + debug时出现此错误:

I got this error when I press build+debug:

ld: duplicate symbol .objc_class_name_BlogTableItemCell in /Users/fabian/Development/Workspaces/iphone_experiments/xcode_build_output/MausLog.build/Debug-iphonesimulator/MausLog.build/Objects-normal/i386/BlogTableItemCell-3733583914888A7B.o and /Users/fabian/Development/Workspaces/iphone_experiments/xcode_build_output/MausLog.build/Debug-iphonesimulator/MausLog.build/Objects-normal/i386/BlogTableItemCell-3733583914888A7B.o
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

推荐答案

似乎您正在同一代码的不同位置两次编译同一BlogTableItemCell类.在以下情况下可能会发生这种情况.

It seems that you are compiling the same BlogTableItemCell class two times in different places of your code. This may happen in the following cases.

  • 您已经上过同一堂课 实施分为两个不同 档案;

  • You have put the same class implementation into two different files;

您实际上只有一个 但是,该类的实现 您还在项目中链接了一个框架 或包含其类的类的库 名称与您的名字完全相同.

You actually have just one implementation of this class, however you are also linking in your project a framework or library containing a class whose name is exactly the same of yours.

尝试在整个项目中查找您的班级,并确保项目中只有一个副本.

Try finding in the whole project your class and make sure only one copy is available within your project.

这篇关于在Objective-C构建中出现重复的符号错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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