Dispelling Colleague's Arguments
If he believes that splitting your code into shared libraries will improve modularity, testability, and code reuse, then I think it means that he believes that you have some problems with your code and that using the shared library architecture "correct her.
Modularity?
Your code should have unwanted interdependencies that would not be related to a cleaner separation between "library code" and "code using library code."
Now this can be achieved with the help of static libraries.
Testing?
Your code may be better tested, it may build unit tests for each separate shared library that is automated during each compilation.
Now this can be achieved with the help of static libraries.
Code reuse?
Your colleague would like to reuse some code that is not displayed because it is hidden in the sources of your monolithic application.
Conclusion
Points 1 and 2 can still be reached using static libraries. 3 will make shared libraries mandatory.
Now, if you have more than one library linking depth (I'm thinking of linking two static libraries that have been compiled, linked to other libraries), this can be tricky. On Windows, this leads to an error for the link, because some functions (usually C / C ++ runtime functions when linking statically) are referenced more than once, and the compiler cannot choose which function to call. I donโt know how it works on Linux, but I think it can happen too.
Dispelling your own arguments
Your own arguments are somewhat biased:
The burden of compiling / linking shared libraries?
The burden of compiling and linking to shared libraries compared to compiling and linking to static libraries does not exist. Therefore, this argument does not matter.
Dynamic loading / unloading?
Dynamically loading / unloading a shared library can be a problem in a very limited use case. In normal cases, the OS loads / unloads the library if necessary without your intervention, and in any case, performance problems lie elsewhere.
Providing C ++ code with C interfaces?
Regarding the use of the C function interface for your C ++ code, I do not understand: you are already linking the static libraries with the C ++ interface. Linking shared libraries is no different.
You would have a problem if you had different compilers to create each library of your application, but this is not the case, since you already link your libraries statically.
Is a double file with one file easier?
You're right.
On Windows, the difference is not significant, but then there is still a Hell DLL problem that disappears if you add a version to your library names or work with Windows XP.
On Linux, in addition to the problem with Windows above, you have the fact that by default shared libraries must be in some system directories by default in order for them to be used, so you have to copy them during installation (which can be a pain ... ) or change some default environment settings (which may also hurt ...)
Conclusion: who is right?
Now your problem is not, "is my colleague right?" Is he. Like you.
Your problem:
- What do you really want to achieve?
- Is the work necessary for this task necessary?
The first question is very important, because it seems to me that your arguments and the arguments of your colleagues are biased in order to lead to a conclusion that seems more natural for each of you.
Put it in a different wording: each of you already knows what should be the ideal solution (according to each point of view), and each of you puts together arguments to reach this solution.
There is no way to answer this hidden question ...
^ _ ^