1. 程式人生 > >linux 編譯靜態庫檔案

linux 編譯靜態庫檔案

編譯步驟:

gcc -c  *.c

編譯靜態庫

ar  -r libtest.a   *.o

編譯執行檔案

gcc main.c -L  libtest.a  -o main

./main