C ++-lib中的哪些更改会触发客户端重建? [英] C++ - What changes in lib triggers client rebuild?

查看:92
本文介绍了C ++-lib中的哪些更改会触发客户端重建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个lib,想在其类之一中添加一个新函数.这将仅由我正在构建的新客户端使用.
但是,该库通常在VOB之间共享,并且被许多客户端使用.

我的问题是:
1)我是否需要重新编译和重新部署所有这些客户端,即使它们没有调用此新函数或以其他方式不知道此函数?
2)有办法解决吗?

更广泛的说:lib .h,.cpp中的哪些变化要求客户端重新编译?



在此先感谢

I have a lib and want to add a new function in one of its classes. This will be used only by the new client I am building.
However, the library is commonly shared between VOBs and used by many clients.

My question is:
1) Do I need to recompile and redeploy all of these clients, even though they are not calling this new function or otherwise unaware of this function?
2) Is there a way around this?

On a broader stroke: What kind of changes in lib .h, .cpp require clients to recompile?



Thanks in advance

推荐答案

如果.h文件中的任何内容发生更改,客户端只需要重新编译即可;这是客户端代码和库之间的接口.如果他们需要使用该库的较新版本(错误修复等),则只需要重新链接到新库即可.
Clients should only need to recompile if anything in the .h file changes; that is the interface between the client code and the library. If they need to use a newer version of the library (bug fixes etc.) then they should just need to re-link to the new library.


如果界面更改,则需要重新编译后,除非您设法在不更改界面的情况下添加功能,否则您将无法真正解决此问题.

为了解决这个问题,大多数人使用基于插件的体系结构. (例如:COM)
if the interface changes then you need to recompile, you cant really go around this unless you menage to add the functionality without changing the interface.

to order to solve this most people use a plugin based architecture. (example: COM)


这篇关于C ++-lib中的哪些更改会触发客户端重建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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