Added extern "C" to avoid C++ name mangling in the generated shared library.