Add extern "C" to compile with C++ compiler.