结合静态库 [英] Combine static libraries

查看:113
本文介绍了结合静态库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过这个办法<一href=\"http://stackoverflow.com/questions/3821916/how-to-merge-two-ar-static-libraries-into-one\">question,但似乎 Linux版AR 是不一样的Mac版本,因为我没有对象文件再次结合起来。

I tried the approach in this question, but it seems the linux version of ar is not the same as the mac version since I failed to combine the object files again.

我基本上想要做的就是通过一个运行脚本生成阶段合并另一静态库到我的X code静态库构建产品。

What I basically want to do is is merge another static library into my Xcode static library build product via a run-script build phase.

不幸的是我不能直接编译其他图书馆到我的项目,因为它有它自己的编译系统(因此我使用编译库)。

Unfortunately I can't compile the other library directly into my project because it has it's own build system (therefore I use the compiled libs).

我觉得应该可以通过 AR 其他库合并进入X code生成的库没有反编译生成的产品。我如何做到这一点?

I think it should be possible to merge the other library via ar into the Xcode generated library without decompiling the build product. How do I accomplish this?

推荐答案

您可以使用的libtool 来做到这一点。

you can use libtool to do it

libtool -static -o new.a old1.a old2.a

这篇关于结合静态库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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