Reputation: 11431
I have a C++ applicatoin which uses dynamically linked libary. I have placed application and library on target and application is running. Now i have changed some thing in library and made the library and replaced old library on target with new library.
My questions is
Thanks!
Upvotes: 0
Views: 184
Reputation: 24869
If you are just talking about binary compatibility and whether it is necessary to recompile and relink the application, then you should read the link provided in peoro's answer.
However, I am slightly confused by the "application is running" part of your question. If you mean that it is in fact running at the very moment when you replace the library, then it won't use the new version unless it's restarted first or another instance of the application is started (but then the old instance would still use the old version). Not every OS will allow you to just replace a library that is in use by an application, but there are workarounds. In Windows, you can't overwrite or delete the old library, but you can move or rename it before putting the new version there. Linux will allow you to delete the old version, and if you copy the new version using the install
command, it will do it automatically for you. But the old version won't be deleted physically from the file system until the application finishes, it will just be invisible.
Upvotes: 0
Reputation: 26060
Yes, but only if your new library is ABI compatible with the older one.
You can find many info about it on the web. I'd suggest you to read this FAQ about binary compatibility.
Upvotes: 1
Reputation: 5054
Yes. The library is loaded at run-time by the dynamic linker. As long as the ABI is preserved (same compiler and version), your code will use the new code seamlessly without need for recompilation.
Upvotes: 0
Reputation: 272497
Yes, so long as the interface hasn't changed. That's one advantage of dynamically-linked libraries.
Upvotes: 0