一般情况下 我们使用 ar rcs 命令在 unix 上创建静态库。
这里的标志's'是什么意思 手册页说
Do not generate an archive symbol table. This can speed up building a large library in several steps. The resulting archive can not be used with the linker. In order to build a symbol table, you must omit the S modifier on the last execution of ar, or you must run ranlib on the archive.
我对这句话感到困惑 “生成的存档可以 不能与链接器一起使用。”。
在 ar 命令之后我们是否必须使用 ranlib 来创建静态库? ranlib 的用途是什么以及如何使用?
最佳答案
ranlib
实用程序在库中创建索引,链接器使用该索引进行查找。请注意,ar
中的省略索引命令是大写的 S - 构建索引的命令是小写的 s,您应该使用它。运行ar rcs
后无需再使用ranlib
。
关于unix - 静态库创建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3054705/