Build fixes for C++ examples on Linux