If you link libcurl statically, then the end user does not require libcurl, since it will be associated with the executable directly at compile time.
If you bind libcurl dynamically, then the end user requires libcurl to be installed on their system and accessible as a shared library of objects.
However, you are in a different place. You are writing a library for use by other developers. So your end user is not really an end user. In such scenarios, it is βbetterβ to provide dynamic communication with libcurl.
If you linked statically, then your library will encapsulate a copy of the libcurl library in your code. Now imagine that the developer using your library also uses 10 other libraries, all statically linked to libcurl. This developer will mainly include 10 copies of libcurl in his final product. This is not very efficient and, therefore, dynamic dependency binding is preferable when developing a library.
But...
If a developer uses 10 different libraries that require libcurl, but some of these libraries require an older / newer version than others, then static linking will be useful.
Hope this helps ...
Adam jorgensen
source share