官术网_书友最值得收藏!

Static libraries

Static libraries are a collection of object files that are linked at compile time. In Linux (and most UNIX-based systems), static libraries are nothing more than an archive of object files. You can easily take an existing static library and use the AR tool to extract the original object files. 

Unlike object files that are linked as part of your program, object files that are linked as part of a static library only include the source code needed by that static library, providing optimization that removes unused code from your program, ultimately reducing the total size of your program.

The downside to this approach is that the order in which a program is linked using static libraries matters. If a library is linked before the code that needs the library is provided (on the command line, that is), a link error will occur, as the code from the static library will be optimized out. 

Libraries provided by the operating system usually do not support static linking either, and, typically, static linking of operating system libraries is not needed as those libraries are likely to have been loaded into memory by your operating system. 

主站蜘蛛池模板: 永寿县| 日土县| 正安县| 铅山县| 綦江县| 灵川县| 金门县| 循化| 驻马店市| 缙云县| 容城县| 陇西县| 修水县| 泽普县| 清远市| 通河县| 张家川| 麦盖提县| 门源| 温州市| 延长县| 太和县| 金塔县| 寻乌县| 炉霍县| 岱山县| 共和县| 观塘区| 泰兴市| 临高县| 绵竹市| 道孚县| 宜宾县| 阿巴嘎旗| 双牌县| 金堂县| 林周县| 翼城县| 沂水县| 保山市| 澄城县|