Extract common base header for C and C++ APIs
Fix build error