int sum, A[1000]; sum = 0; for (i = 0, i < 1000; i++) sum += A[i];
gcc -c -fPIC lock.c gcc -c -fPIC lockinit.c gcc -c -fPIC unlock.c
ar rc libspin.a lock.o lockinit.o unlock.o ranlib libspin.a
gcc -o sumprocess code22.c -L. -lspinThe piece tells gcc to look in the current directory in addition to the other library directories for finding .
gcc -shared -fPIC -o libspin.so lock.o lockinit.o unlock.o
gcc -o sumprocess1 code22.c -L. -lspin