#!/bin/bash gcc -c -Wall -Werror -fpic foo.c gcc -shared -o libfoo.so foo.o gcc -c -Wall -Werror -fpic boo.c gcc -shared -o libboo.so boo.o gcc -Wl,-rpath=/root/compile -L. -Wall -o test main.c -lfoo -lboo ./test