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

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. 

主站蜘蛛池模板: 福建省| 华容县| 库伦旗| 杭锦后旗| 铁力市| 鄂托克前旗| 呼和浩特市| 久治县| 大姚县| 县级市| 大英县| 辉县市| 北宁市| 康乐县| 定西市| 永胜县| 滁州市| 中宁县| 宜春市| 太仆寺旗| 景宁| 安化县| 平罗县| 伊川县| 维西| 葫芦岛市| 普宁市| 静宁县| 宝清县| 苍南县| 甘洛县| 荃湾区| 扎鲁特旗| 龙岩市| 英德市| 辽中县| 玉环县| 石首市| 安龙县| 黄龙县| 松滋市|