Added extern C

The library not compiles in a C++ project with an "undefined error".
Added extern "C" to avoid this problem.