build as C++
fix the build by marking the externs as extern "C"