Important caveats of developing shared libraries in C++
Developing shared libraries in C++ requires careful consideration to ensure compatibility, stability, and usability. Originally, shared libraries were intended to promote code reuse, modularity, and efficient memory usage, allowing multiple programs to use the same library code simultaneously. This approach was expected to reduce redundancy, save system resources, and provide the ability to replace only parts of applications. While this approach worked well for widely used libraries, such as libc
, libstdc++
, OpenSSL, and others, it proved to be less efficient for applications. Shared libraries provided with an application can rarely be spotlessly replaced with a newer version. Usually, it is required to replace the whole installation kit, which includes the application and all its dependencies.
Nowadays, shared libraries are often used to enable interoperability between different programming languages. For instance, a C++ library...