views:

68

answers:

3

Why does update to a dll need recompilation and sometime not?

+1  A: 

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:

If you use COM and follow the COM guide, you should be safe all the time.

note: some compiler flags also break binary compatibility.

J-16 SDiZ
+2  A: 

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.

Max Lybbert
you forgot the case when export symbols change, as the program won't even start correctly if the OS cannot find a linked symbol
Necrolis
I could swear that I wrote (in bold) "please note: This list is NOT exhaustive." And I can swear that usually means "there may be cases that I did not put on the list."
Max Lybbert
+1  A: 

The link from KDE base explain preciously what I am looking for.

Passionate programmer
In that case, accept J-16 SDiZ's answer.
Max Lybbert