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

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. 

主站蜘蛛池模板: 甘洛县| 宽城| 卢龙县| 三亚市| 祥云县| 嘉祥县| 东丽区| 武夷山市| 彭山县| 华阴市| 内黄县| 崇州市| 锦州市| 镇赉县| 龙胜| 阳泉市| 深州市| 陈巴尔虎旗| 信丰县| 绥芬河市| 禄丰县| 浦县| 滨海县| 彝良县| 栖霞市| 宣化县| 平塘县| 彭水| 新丰县| 舒兰市| 保康县| 文水县| 平乐县| 漳平市| 盐源县| 茌平县| 敦煌市| 吴桥县| 五原县| 嘉义市| 南和县|