After intalling the libraries libgsm1 and libgsm1-dev, you can create the shared library codec_gsm.so with: gcc -shared -o codec_gsm.so gsmcodec.cpp -lgsm