[An Introduction to GCC 学习笔记] 07 链接外部静态库
Posted 漫小牛
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[An Introduction to GCC 学习笔记] 07 链接外部静态库相关的知识,希望对你有一定的参考价值。
Creating a Library with ar
- The GNU archiver ar combines a collection of objects files into a single archive file, also know as a library. An archive file is simply a convenient way of distributing a large number of related object files together.
- You can use the followning command to create a static library:
$ ar cr libName.a file1.o file2.o ... filen.o
- The archiver ar also provides a “table of contents” option ‘t’ to list the object files in an existing library.
$ ar t libName.a
- 手动创建一个库,并看一看在不同位置时,gcc是怎么调用它的。
以上是关于[An Introduction to GCC 学习笔记] 07 链接外部静态库的主要内容,如果未能解决你的问题,请参考以下文章
[An Introduction to GCC 学习笔记] 09 -Wall
[An Introduction to GCC 学习笔记] 14 优化问题3
[An Introduction to GCC 学习笔记] 14 优化问题3
[An Introduction to GCC 学习笔记] 13 优化问题2