I\'m trying to use a shader but it keeps telling me this error on both fragment and vertex shader:
error(#132) Syntax error: \"<\" parse error
Your error and the lack of a < token in your shader sources suggests that glShaderSource is reading into trailing garbage at the end of the strings.
This sounds like a subtle problem known to the seasoned developers but that can stump the newbies. glShaderSource either expects zero terminated strings and a NULL pointer for the length array or you're passing an array with lengths so that the strings don't need to be 0 terminated. Technically std::string::c_str should give access to a zero terminated string, but it seems in your case it doesn't.
Anyway the simple solution is to provide a length array, so that glShaderSource doesn't read into trailing garbage:
// Do a quick switch so we can do a double pointer below
const char *vvshader = vshader.c_str();
const char *ffshader = fshader.c_str();
const GLint lenvshader = vshader.length();
const GLint lenfshader = fshader.length();
// Now this assigns the shader text file to each shader pointer
glShaderSource(VertexShader, 1, &vvshader, &lenvshader);
glShaderSource(FragmentShader, 1, &ffshader, &lenfshader);