Continue port to C++. It now compiles on Linux.