ABI-Compatibility of visual studio c-libraries
Asked Answered
P

1

6

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.

Now my questions are:

  • 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?

(in particular in light of the refactoring and stabilization of the crt)

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.

Placement answered 1/2, 2017 at 9:3 Comment(2)
Pure C is stable (have found statement in the past - if I can find it again will posts as an answer). Note that all of the Win32API methods (including COM) are exported as C. Making a breaking change to the C ABI would break all the calls into the OS.Fulk
@RichardCritten: Thank you very much. That was pretty much what I expected, but I couldn't find official documentation. It would be great, if you could find a source for it, but I would also accept your answer without it.Placement
G
2

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).

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)

Gudrin answered 5/4, 2017 at 13:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.