Compiling and using a shared object using g++