finally, read.cpp compiles on windows, mac and linux