Add extern C
Make C++ static initialization work
Add missing function (no implementation)
Some adjustments for test environment