diff --git a/pbs/swig_compile_pbs.sh b/pbs/swig_compile_pbs.sh
index 42ba2babe68306b1e2d99969a28b2d33df41a018..c5c71ba03f030a9408ee6e0e6c6f337987d1024a 100755
--- a/pbs/swig_compile_pbs.sh
+++ b/pbs/swig_compile_pbs.sh
@@ -36,7 +36,7 @@ if [ $? -ne 0 ]; then
 fi
 
 # Running gcc creates _pbs.so
-gcc -shared -fPIC -I$PYTHON_INCL -I$PBS_EXEC/include pbs_wrap.c $PBS_EXEC/lib/libpbs.a \
+gcc -shared -fPIC -I$PYTHON_INCL -I$PBS_EXEC/include pbs_wrap.c $PBS_EXEC/lib/libpbs.so \
     -o _pbs.so -L/lib -lcrypto -lssl
 
 # It does not need to be executable.