Visual Studio C库的ABI兼容性 [英] ABI-Compatibility of visual studio c-libraries

查看:256
本文介绍了Visual Studio C库的ABI兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解(除了从VS2015切换到VS2017的显着例外),Microsoft使ABI打破了Visual C ++工具链的每个版本之间的更改.因此,如果要分发库的二进制版本,则必须为我要支持的每个新版本的VS分发该库的单独版本.

It is my understanding that (with the notable exception of the switch from VS2015 to VS2017) Microsoft makes ABI breaking changes between each version of the Visual C++ toolchain. So if I want to distribute a binary version of a library, I have to distribute a separate version of that for each new version of VS that I want to support.

现在我的问题是:

  • 对于纯c库也是如此吗?
  • dll和静态库之间的答案是否不同?
  • MS是否有关于他们未来目标的官方政策?
  • Is this is also true for pure c-libraries?
  • Does the answer differ between dlls and static libraries?
  • Is there an official policy from MS on what they aim for in the future?

(尤其是考虑到 CRT的重构和稳定)

如果这是相关的,我会对Win10的特定答案感到满意,但是我也对自(包括)Win7之后的所有Windows版本都感兴趣.我感兴趣的VS Studio版本是VS2013/15/17,并且-可以做出任何预测-将来的版本.

If this is relevant I'd be content with an answer specific to Win10 but I'm also interested in all windows versions since (and including) Win7. Versions of VS Studio that are of interest to me are VS2013/15/17 and - as far as any predictions can be made - future releases.

推荐答案

纯C的ABI肯定是稳定的.您可以混合使用不同VisualStudio版本制作的DLL,只要您还具有正确的MSVCRT *依赖关系(如果您显然使用静态libc构建它们,则不适用).

The ABI of pure C is surely stable. You can mix DLLs made with different VisualStudio version, as long as you also have the correct MSVCRT* dependencies (this does not apply if you build them with static libc obviously).

但是,在传递指针时必须特别小心(请参阅 http://siomsystems .com/mixing-visual-studio-versions/以及 Visual Studio版本之间的库ABI兼容性)

However you have to take special care in passing pointer around (see http://siomsystems.com/mixing-visual-studio-versions/ and also Library ABI compatibility between versions of Visual Studio)

这篇关于Visual Studio C库的ABI兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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