Last week, we were talking about static vs dynamic linking from a binary size point of view. Around the end of the article, I wrote that I omitted other aspects.
For - quite - some time at the beginning of my career, I simply thought that dynamic linking was just better. After all, if something is dynamic, it’s better than being static, right?! Honestly, I didn’t even give too much thought to this question.
We’ve already seen that in many scenarios, static linking will decrease the binary size. But that’s not the only aspect where static linking might help you.
With static linkage, deployment is easier. The reason is that you ship everything or at least almost everything that you need to run your executable. It’ll work out of the box, maybe you need to have system libraries in place, but that’s it.
On the other hand, with dynamic linking, you have to make sure that all the necessary libraries are also available in the right version of the system where you want to execute your binary.