I think the SimpleVertexShader error is referring to the "layout" code and the SimpleFragmentShader error is referring to the "out" code.
You're right, in/out variables are available since GLSL 1.40. In the previous version you have to use "attribute" keyword (for vertex shader's input), "varying" keyword (for variables passed from a vertex shader to a fragment shader) and "gl_FragData" for fragment shader's output.
"layout" is avialable since even newer version (I don'r remember which exactly). You have to specify indices from C++ using glBindAttribLocation.