fix a build issue and start using a shared library