Are C++ libs created with different versions of Visual Studio compatible with each other?

后端 未结 4 807
遥遥无期
遥遥无期 2020-12-03 05:07

I am creating a open-source C++ library using Visual Studio 2005. I would like to provide prebuilt libs along with the source code. Are these libs, built with VS2005, also g

4条回答
  •  [愿得一人]
    2020-12-03 05:24

    Generally it's not possible to link against libraries built with different compilers, different versions of the same compiler, and even different settings of the same compiler version and get a working application. (Although it might work for specific subsets of the language and std library.) There is no standard binary interface for C++ - not even one for some common platform as there are in C.

    To achieve that, you either need to wrap your library in a C API or you will have to ship a binary for every compiler, compiler version, and compiler setting you want to support.

提交回复
热议问题