Added c++ compatibility to use the lib in c++-projects

Signed-off-by: Luotao Fu <devtty0@gmail.com>