Fix C++ build errors in Linux