【问题标题】:ld: 1 duplicate symbol for architecture armv7ld:架构 armv7 的 1 个重复符号
【发布时间】:2013-02-24 23:56:41
【问题描述】:

这个问题快把我逼疯了。我似乎无法弄清楚。它突然发生了。我查看了各种相关消息,但找不到适合我的解决方案。

Ld "/Users/mmemmo/Library/Developer/Xcode/DerivedData/Simple_Science_Tab-gifjwcnwxnqxuhacsbdlutruxepk/Build/Products/Debug-iphoneos/Simple Science Tab.app/Simple Science Tab" normal armv7
cd "/Users/mmemmo/Dropbox/Apple/Simple Science Tab"
setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/mmemmo/Library/Developer/Xcode/DerivedData/Simple_Science_Tab-gifjwcnwxnqxuhacsbdlutruxepk/Build/Products/Debug-iphoneos -F/Users/mmemmo/Library/Developer/Xcode/DerivedData/Simple_Science_Tab-gifjwcnwxnqxuhacsbdlutruxepk/Build/Products/Debug-iphoneos -filelist "/Users/mmemmo/Library/Developer/Xcode/DerivedData/Simple_Science_Tab-gifjwcnwxnqxuhacsbdlutruxepk/Build/Intermediates/Simple Science Tab.build/Debug-iphoneos/Simple Science Tab.build/Objects-normal/armv7/Simple Science Tab.LinkFileList" -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.0 -lsqlite3 -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/mmemmo/Library/Developer/Xcode/DerivedData/Simple_Science_Tab-gifjwcnwxnqxuhacsbdlutruxepk/Build/Products/Debug-iphoneos/Simple Science Tab.app/Simple Science Tab"

duplicate symbol _dbfn in:
/Users/mmemmo/Library/Developer/Xcode/DerivedData/Simple_Science_Tab-gifjwcnwxnqxuhacsbdlutruxepk/Build/Intermediates/Simple Science Tab.build/Debug-iphoneos/Simple Science Tab.build/Objects-normal/armv7/ssDataBrains.o
/Users/mmemmo/Library/Developer/Xcode/DerivedData/Simple_Science_Tab-gifjwcnwxnqxuhacsbdlutruxepk/Build/Intermediates/Simple Science Tab.build/Debug-iphoneos/Simple Science Tab.build/Objects-normal/armv7/ssCheckInViewController.o

ld:架构 armv7 的 1 个重复符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

【问题讨论】:

  • 请不要包含“任何建议都会受到欢迎”。在你的问题中。这是无用的噪音。
  • 嗨@user1362262,关闭Xcode并删除/Users/mmemmo/Library/Developer/Xcode/DerivedData中的所有数据...它帮助了我..希望它也能帮助你..

标签: xcode ios6 xcode4.2


【解决方案1】:

[不确定你的水平...]

问题是两个.o 文件都定义了一个外部符号_dbfn。如果 .o 文件是从 .c(或 .m 或其他文件)派生的,那么在这些文件的某处,您将看到一个名为 dbfn 的变量/符号。您可以 grep 或在 Xcode 中搜索它或再次在 Xcode 中使用符号导航器来查找已定义的符号。

符号 dbfn 有可能定义在这两个 .o 文件都包含的文件中。使用 cc -E <source.c> 查看扩展的源代码和 grep 的 dbfn。

您可以执行“nm .o”来了解有关 dbfn 符号及其类型的更多信息。

注意:使用 nm 和 cc 需要您安装 Xcode 命令行工具。

【讨论】:

  • 在这两个 o 都包含的文件中定义的 dbfn 有什么问题。文件?不能从两个不同的文件访问吗?
  • 问题是两个文件定义符号_dbfn。如果两个文件访问在一个文件中其他地方定义的相同符号,则没有问题。
猜你喜欢
  • 2017-06-09
  • 2014-09-27
  • 1970-01-01
  • 2013-09-11
  • 1970-01-01
  • 1970-01-01
  • 2016-04-29
  • 2013-05-01
  • 2012-11-23
相关资源
最近更新 更多