How to design a C++ API for binary compatible extensibility

Several months ago I wrote an article called “Binary Compatibility of Shared Libraries Implemented in C++ on GNU/Linux Systems” [pdf]. While concepts are similar on Windows system, I’m sure they’re not exactly the same. But having read the article you can get a notion on what’s going on at C++ binary level that has anything … Read more

Is JDK “upward” or “backward” compatible?

Note that for something to be backwards compatible there must be a counterpart that is forwards compatible (either intentionally or unintentionally). For example: are the DVD readers backwards compatible with CD’s or are the CD’s forward compatible with DVD readers? In this case, it depends if you look at the compiler (or the bytecode it … Read more

__cdecl or __stdcall on Windows?

I just did some real-world testing (compiling DLLs and applications with MSVC++ and MinGW, then mixing them). As it appears, I had better results with the cdecl calling convention. More specifically: the problem with stdcall is that MSVC++ mangles names in the DLL export table, even when using extern “C”. For example foo becomes _foo@4. … Read more

What causes java.lang.IncompatibleClassChangeError?

This means that you have made some incompatible binary changes to the library without recompiling the client code. Java Language Specification ยง13 details all such changes, most prominently, changing non-static non-private fields/methods to be static or vice versa. Recompile the client code against the new library, and you should be good to go. UPDATE: If … Read more