1. add extern C. 2. unit test with gtest