$ gcc -c fact.c -o fact.o
產生靜態函式庫
$ ar rcs libfact.a fact.o
使用靜態函式庫
$ tree
.
├── fact.h
├── libfact.a
├── main.c
$ gcc -static main.c -L. -lfact -o main
References :
segfault.in » How to create static libraries with gcc?
$ gcc -c fact.c -o fact.o
$ ar rcs libfact.a fact.o
$ tree
.
├── fact.h
├── libfact.a
├── main.c
$ gcc -static main.c -L. -lfact -o main
gcc 模擬 32 位元# apt-get install ia32-libs-dev
# apt-get install lib32z1-dev
$ gcc -m32 -o output32 hello.c