<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] ## 靜態庫 靜態庫,也叫歸檔文件(archive),因此按慣例得到`.a`結尾后綴的庫文件(比如`/usr/lib/libc.a`) 自己制作靜態庫:基于`ar`程序和`gcc -c`(編譯、匯編到目標代碼,不進行鏈接)對函數分別進行編譯,應該盡可能的分別保存到不同的源文件中,公共數據保存在同一個源文件中(基于聲明的靜態變量) ### 自己創建靜態庫 <details> <summary>fred.c</summary> ``` #include <stdio.h> void fred(int arg) { printf("fred: we passwd %d \n", arg); } ``` </details> <br/> <details> <summary>bill.c</summary> ``` #include <stdio.h> void bill(char *arg) { printf("bill: we passwd %s\n", arg); } ``` </details> <br/> <details> <summary>bf.h</summary> ``` #include <stdlib.h> #include "bf.h" int main() { bill("hey man, cool"); exit(0); } ``` </details> <br/> <details> <summary>porg.c</summary> ``` #include <stdlib.h> #include "bf.h" int main() { bill("hey man, cool"); exit(0); } ``` </details> <br/> 命令行鏈接 & 打包 ``` gcc -c *.c #編譯成object,用于鏈接和做成靜態庫 gcc -o prog prog.o bill.o #鏈接輸出到prog執行文件 // 制作靜態庫 ar crv libfoo.a bill.o fred.o #創建庫文件 ranlib libfoo.a #為函數庫生成內容表,后續可以基于`nm libfoo.a`或者`nm prog`查看 // 編譯鏈接 gcc -o prog2 prog.c -L. -lfoo // 或者 gcc -o prog1 prog.c -L. libfoo.a ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看