#!/bin/bash gcc -c -Wall -Werror -fpic foo.c gcc -shared -o libfoo.so foo.o ar rcs libfoo.a foo.o gcc -c -Wall -Werror -fpic boo.c gcc -shared -o libboo.so boo.o ar rcs libboo.a boo.o gcc -static -L. -Wall -o test main.c ./libfoo.a ./libboo.a export LD_LIBRARY_PATH=. ./test ldd test