Building as shared libraries, adding extern C calls to support use from C++