Question

If a class interface doesn't change, but its implementation changes, (and accordingly the library file containing the class' functionality code) does the client code (driver app) need to be recompiled?

If the driver application doesn't require to be recompiled after the mentioned change, how would the executable file locate the new location of the edited method in the new library (the one containing the new class' edited functionality)?

Was it helpful?

Solution 2

If a class interface doesn't change, but its implementation changes, (and accordingly the library file containing the class' functionality code) does the client code (driver app) need to be recompiled?

Generally speaking, no. If you don't break the ABI, then there is no need.

how would the executable file locate the new location of the edited method in the new library

The same way it did in the old library: the dynamic linker sorts it out for you as your executable boots up.

OTHER TIPS

The ABI is very much dependent on compiler vendor and version. You might get away with not rebuilding the driver application but you have to be really really careful. Define your interface with pure virtual members/functions and no data whatsoever, preferably in a separate include which you do not touch at all.

The .dll or .so file (or equivalent) has to be replaced in the loaded module either by hard file moving or by changing the reference to where the dynamic linker will look for .dll/.so files. On unix/linux commonly an environment variable named LD_LIBRARY_PATH

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top