If the signatures of the functions involved have not changed, then the "rebuilding" of the program means that the object files must be linked again. You will not need to compile them again.
An API is a contract that describes an interface for public functions in a library. When the compiler generates code, it needs to know what type of variables will be passed to each function and in what order. He also needs to know the type of return, so he knows the size and format of the data that will be returned from the function. When your code is compiled, the address of the library function can be represented as "the beginning of the library plus 140 bytes." The compiler does not know the absolute address, so it simply indicates the offset from the beginning of the library.
But inside the library, the contents (i.e. implementation) of functions may change. When this happens, the code length may change, so the addresses of functions may change. It is the task of the linker to understand where the entry points of each function are and fill in these addresses in the object code to create an executable file.
On the other hand, if the data structures in the library have changed, and the library requires callers to manage the memory (bad practice, but unfortunately shared), you will need to recompile the code so that it can account for changes. For example, if your code uses malloc(sizeof(dataStructure)) to allocate memory for the library data structure doubled in size, you need to recompile the code because sizeof(dataStructure) will have a larger value.
Adam liss
source share