Easy way to guarantee binary compatibility for C++ library, C linkage?
问题 I don't know exact way to guarantee binary compatibility for C++ library on both Windows and Linux. But I think if I make all exposed APIs with a C linkage I think I can easily guarantee this compatibility on both Windows and Linux. It's like below : extern "C" int SomeAPI(); Rest of the functions surely will be written in C++. Only the APIs exposed to outter world will have C linkage. And the exposed API's must be pure C function - no exceptions, no C++ types are used. Am I right or wrong?