Dll compatibility between compilers

后端 未结 9 1680
小蘑菇
小蘑菇 2021-01-02 08:35

Is there some way to make c++ dlls built with diffrent compilers compatible with each other? The classes can have factory methods for creation and destruction, so each compi

9条回答
  •  时光说笑
    2021-01-02 09:07

    You can as long as you only use extern "C" functions.

    This is because the "C" ABI is well defined, while the C++ ABI is deliberately not defined. Thus each compiler is allowed to define its own.

    In some compilers the C++ ABI between different versions of the compiler or even with different flags will generate an incompatable ABI.

提交回复
热议问题