• <small id='ObhlU'></small><noframes id='ObhlU'>

        <bdo id='ObhlU'></bdo><ul id='ObhlU'></ul>
      <legend id='ObhlU'><style id='ObhlU'><dir id='ObhlU'><q id='ObhlU'></q></dir></style></legend>
    1. <i id='ObhlU'><tr id='ObhlU'><dt id='ObhlU'><q id='ObhlU'><span id='ObhlU'><b id='ObhlU'><form id='ObhlU'><ins id='ObhlU'></ins><ul id='ObhlU'></ul><sub id='ObhlU'></sub></form><legend id='ObhlU'></legend><bdo id='ObhlU'><pre id='ObhlU'><center id='ObhlU'></center></pre></bdo></b><th id='ObhlU'></th></span></q></dt></tr></i><div id='ObhlU'><tfoot id='ObhlU'></tfoot><dl id='ObhlU'><fieldset id='ObhlU'></fieldset></dl></div>
      <tfoot id='ObhlU'></tfoot>
      1. 如何使用 g++ 创建静态库?

        时间:2023-09-19

        <legend id='Y3rGZ'><style id='Y3rGZ'><dir id='Y3rGZ'><q id='Y3rGZ'></q></dir></style></legend>

        <i id='Y3rGZ'><tr id='Y3rGZ'><dt id='Y3rGZ'><q id='Y3rGZ'><span id='Y3rGZ'><b id='Y3rGZ'><form id='Y3rGZ'><ins id='Y3rGZ'></ins><ul id='Y3rGZ'></ul><sub id='Y3rGZ'></sub></form><legend id='Y3rGZ'></legend><bdo id='Y3rGZ'><pre id='Y3rGZ'><center id='Y3rGZ'></center></pre></bdo></b><th id='Y3rGZ'></th></span></q></dt></tr></i><div id='Y3rGZ'><tfoot id='Y3rGZ'></tfoot><dl id='Y3rGZ'><fieldset id='Y3rGZ'></fieldset></dl></div>

          <small id='Y3rGZ'></small><noframes id='Y3rGZ'>

          • <bdo id='Y3rGZ'></bdo><ul id='Y3rGZ'></ul>

              <tbody id='Y3rGZ'></tbody>
              <tfoot id='Y3rGZ'></tfoot>
                • 本文介绍了如何使用 g++ 创建静态库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  谁能告诉我如何从 .cpp 和 .hpp 文件创建静态库?我需要创建 .o 和 .a 吗?我还想知道如何编译静态库并在其他 .cpp 代码中使用它.我有 header.cpp, header.hpp . 我想创建 header.a.测试 test.cpp 中的 header.a.我正在使用 g++ 进行编译.

                  Can someone please tell me how to create a static library from a .cpp and a .hpp file? Do I need to create the .o and the .a? I would also like to know how can I compile a static library in and use it in other .cpp code. I have header.cpp, header.hpp . I would like to create header.a. Test the header.a in test.cpp. I am using g++ for compiling.

                  推荐答案

                  创建 .o 文件:

                  g++ -c header.cpp
                  

                  将此文件添加到库中,必要时创建库:

                  add this file to a library, creating library if necessary:

                  ar rvs header.a header.o
                  

                  使用库:

                  g++ main.cpp header.a
                  

                  这篇关于如何使用 g++ 创建静态库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:__builtin_prefetch,读取多少? 下一篇:Visual Studio 中的 GCC 风格弱链接?

                  相关文章

                  最新文章

                    • <bdo id='kXjc3'></bdo><ul id='kXjc3'></ul>
                    <tfoot id='kXjc3'></tfoot>
                  1. <small id='kXjc3'></small><noframes id='kXjc3'>

                    <i id='kXjc3'><tr id='kXjc3'><dt id='kXjc3'><q id='kXjc3'><span id='kXjc3'><b id='kXjc3'><form id='kXjc3'><ins id='kXjc3'></ins><ul id='kXjc3'></ul><sub id='kXjc3'></sub></form><legend id='kXjc3'></legend><bdo id='kXjc3'><pre id='kXjc3'><center id='kXjc3'></center></pre></bdo></b><th id='kXjc3'></th></span></q></dt></tr></i><div id='kXjc3'><tfoot id='kXjc3'></tfoot><dl id='kXjc3'><fieldset id='kXjc3'></fieldset></dl></div>
                      <legend id='kXjc3'><style id='kXjc3'><dir id='kXjc3'><q id='kXjc3'></q></dir></style></legend>