The library under Linux, no matter what platform, there are only two kinds, one is:
- Dynamic libraries, multiple shares can be shared
- Static libraries, compiled directly into the software
This form, no matter where, will not change! However, it can vary depending on the platform, for example: Under Windwos:. lib files and. dll files under Linux are:. A files and. So files are archived under Mac [I don't know yet]
Therefore, the use of different platforms, some are different, but the principle is the same, we only learned the principle, can be extrapolate, on different platforms for reasonable operation and fluency of excessive
Both static and dynamic libraries have advantages and disadvantages, these advantages and disadvantages to learn the rational use, and, every way will be, so that we can cut according to the actual situation, the most appropriate configuration of the software I simply give a few examples: dynamic library, can be multiple software sharing, and only one, if, There are many software to share, then, this is a good way, for example, Baidu's map, provides a so file, so that all the machine can be used, you can not recompile the static library, can be directly compiled into the software, do not have to crawl, a software hanging a lot of dynamic package, This is an unfriendly behavior, and, some software dynamic package super large, and, you are only using one of the small features, this is undoubtedly a bad practice! However, sometimes, you will also find that directly compiled into the software, there will be other bad places, such as: This single software, Super BIG! And it's a super big! Compiling is also a waste of time!
A word clear: large projects with dynamic library, small software directly static compilation
According to the UNIX philosophy: Do not create big things, try to keep concise, we have always been advice, as small as possible, to do invincible little Superman!
Libraries under Linux