重复的符号错误:SBJsonParser.o? [英] Duplicate Symbol Error: SBJsonParser.o?

查看:168
本文介绍了重复的符号错误:SBJsonParser.o?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在我的项目中有一个被编译为静态库的ShareKit。它正确实施。我也通过将框架添加到我的项目中来实现亚马逊的AWS SDK。



似乎重复的符号来自Amazon的AWS SDK文件AWSIOSSDK。这是它的样子:





该文件与ShareKit的文件libShareKit.a冲突。这是该文件的样子:





无论如何,这两个文件都是我以前没看过的文件。而且似乎有一些JSON文件在它们之间相互冲突。



我已经看过其他SO的问题,他们说使用编译的源做一些事情,但是这些文件都没有在任何一个库的编译源中。 >

这是Xcode给出的确切错误:

  ld:重复的符号_OBJC_CLASS_ $ _SBJsonParser 

无论如何,有没有人有任何想法我应该做什么?我的应用程序没有编译,除非我解决这个问题。



谢谢!

解决方案

这两个都将 SBJsonParser 构建到其静态库中。这不是构建静态库的正确方法。每个应该建立没有 SBJson ,然后你应该链接所有它们与 SBJson 。有几个解决方案:




  • 重建这些库(或让他们的维护者这样做)不要将第三方库直接包含在静态库。这是理想的解决方案。

  • .a SBJson c>使用 ar 的文件。您应该可以使用 ar -t 来列出 .a 中的对象,然后 ar -d 删除那些不应该在那里的那些。您当然也可以 ar -x 提取所有的 .o 文件并直接链接。


I currently have ShareKit in my project that is compiled as a static library. It is properly implemented. I also have implemented Amazon's AWS SDK by just adding their framework into my project.

It seems that the duplicate symbol is coming from Amazon's AWS SDK file, "AWSIOSSDK". This is what it looks like:

And that file is colliding with ShareKit's file, libShareKit.a. This is what that file looks like:

Anyway both of these files are ones that I haven't seen before. And it seems that some JSON files are colliding within them.

I have looked at other SO questions and they say to do some things with the compiled sources but none of these files are in the compiled sources from either library.

Here is the exact error Xcode gives:

ld: duplicate symbol _OBJC_CLASS_$_SBJsonParser

Anyway, does anyone have any ideas what I should do? My app does not compile unless I fix this issue.

Thanks!

解决方案

Both of these have built SBJsonParser into their static libraries. This is not the correct way to build a static library. Each should build without SBJson and then you should link all of them together with SBJson. There are a couple of solutions:

  • Rebuild these libraries (or have their maintainers do so) to not include third-party libraries directly into a static library. This is the ideal solution.
  • Remove the incorrect SBJson files from the .a files using ar. You should be able to do this using ar -t to list the objects in the .a and then ar -d to delete the ones that shouldn't be in there. You could of course also ar -x to extract all the .o files and link them directly.

这篇关于重复的符号错误:SBJsonParser.o?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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