其他静态库使用的静态库中的更改 [英] Change in static library used by other static library

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

问题描述

我有2个库文件,lib1.a和lib2.a在我的项目。 Lib1.a正在使用lib2.a。我给了lib2.a的源代码,但我没有lib1.a的源代码。对于我的项目我改变了lib2.a让我说我在函数中添加一个局部变量。

I have 2 library files, lib1.a and lib2.a in my project. Lib1.a is using lib2.a . I have given source code of lib2.a but I don't have source code of lib1.a. For my project I changed lib2.a lets say I add a local variable inside a function.

我的问题,函数名称没有改变,我需要重新编译lib1.a与更改lib2.a?
有没有我告诉链接器lib1.a应该使用新的lib2.a没有lib1.a的源代码?

My question, function names didn't changed, do I need to recompile lib1.a with changed lib2.a ? Is there anyway I tell to linker "lib1.a should use new lib2.a" without source code of lib1.a ?

推荐答案

如果它像一个添加的局部变量,你说,应该没有必要重建其他库。这是因为静态库通常不直接彼此链接,而是可执行文件最终将它们全部链接在一起。

If it's just something like an added local variable as you say, there should be no need to rebuild the other library. This is because static libraries don't typically link each other directly, but rather the executable eventually links them all together.

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

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