如何在其中包含OBJECT文件具有相同名称的静态库? [英] How to include static libraries which have same names for OBJECT files within them?

查看:109
本文介绍了如何在其中包含OBJECT文件具有相同名称的静态库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个iPad应用程序,其中包含2个第三方静态库。这两个库中的目标文件的名称是相同的。在构建应用程序时我得到了

I am developing an iPad app in which I have included 2 third party static libraries. The names of the object files in these 2 libraries are same. On building the app I am getting


Apple Mach -O(id)error

"Apple Mach -O (id) error"

因为这两个库中的目标文件名称相同。
如何解决这个问题?

because of the same names of the object files in those 2 libraries. How to solve this problem?

错误看起来像:

ld: duplicate symbol _T_strcpy in /Users/indiait-supportservices/Desktop/untitled folder/Universal/lib/simulator/libSecurIDLib.a(mem.o) and /Users/indiait-supportservices/Library/Developer/Xcode/DerivedData/ReceiverForiOS-aqpprpcivvjjadbsutqqmtjsoczk/Build/Intermediates/ReceiverForiOS.build/Debug-iphonesimulator/myApp iPad.build/Objects-normal/i386/pdcrypte2.o for architecture i386

collect2: ld returned 1 exit status

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-g++-4.2 

failed with exit code 1.


推荐答案

看起来你有两个定义相同功能的模块,一个在 libSecurIDLib.a(mem.o) pdcrypte2.o 。这些应该在它们自己的命名空间(C ++)中,或者它们应该加上前缀,这样它们就不会碰撞(C)。

It looks like you have two modules defining the same function, one in libSecurIDLib.a(mem.o) and pdcrypte2.o. These should be in their own namespaces (C++) or they should be prefixed so they don't collide (C).

工作周围如果这是不可能的,但最好安全地命名。

There are work arounds if that's impossible, but it's better name things safely.

这篇关于如何在其中包含OBJECT文件具有相同名称的静态库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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