Why does update to a dll need recompilation and sometime not?
This is called "Binary Compatibility". Keeping this compatibility is uneasy, and the information on this are very spare. You should google and test it yourself.
Here are some (incomplete) guide for keeping the compatibility:
- http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++
- http://techbase.kde.org/Policies/Binary_Compatibility_Examples
If you use COM and follow the COM guide, you should be safe all the time.
note: some compiler flags also break binary compatibility.
Obviously a change to a DLL will require recompiling that DLL. However, I think the question you're asking is why you may have to recompile programs that link to that DLL.
There aren't too many ways to change a DLL that will require recompiling code that links with it. If you change the calling convention, or whether the DLL uses a multithreaded/single threaded runtime, or change the parameters that are passed to various functions, or remove functions altogether then you'll have to recompile (please note: this list is NOT exhaustive). If you simply fix a bug inside one of the functions that doesn't change how the function is called, then you won't have to recompile code that dynamically links with the DLL.
The link from KDE base explain preciously what I am looking for.