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

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. 

主站蜘蛛池模板: 巴青县| 吉木乃县| 石台县| 澎湖县| 个旧市| 迁西县| 高雄市| 丰原市| 龙里县| 威海市| 霸州市| 江城| 理塘县| 淮安市| 宁远县| 南宫市| 天台县| 九龙城区| 德格县| 台中县| 弋阳县| 昌平区| 五大连池市| 柯坪县| 微山县| 大关县| 托里县| 奈曼旗| 什邡市| 东辽县| 玉山县| 老河口市| 旬阳县| 浮山县| 苏州市| 榆树市| 荆州市| 湛江市| 合川市| 马关县| 郧西县|