data.c_str() returns a const char*, so do this:
const char *c_str = data.c_str();
glShaderSource(shader, 1, &c_str, NULL);
data.c_str() returns a const char*, so do this:
const char *c_str = data.c_str();
glShaderSource(shader, 1, &c_str, NULL);